$movie_slug, 'with_front' => true, 'feeds' => true, 'pages' => true, ); $movie_labels = array( 'name' => esc_html__('رویدادها', 'amy-movie'), 'singular_name' => esc_html__('رویدادها', 'amy-movie'), 'add_new_item' => esc_html__('افزودن رویداد', 'amy-movie'), 'add_new' => esc_html__('افزودن رویداد جدید', 'amy-movie'), ); $movie_args = array( 'labels' => $movie_labels, 'public' => true, 'has_archive' => false, 'publicly_queryable' => true, 'exclude_from_search' => false, 'menu_icon' => 'dashicons-video-alt', 'supports' => array('title', 'editor', 'comments'), 'rewrite' => $movie_rewrite, ); register_post_type('amy_movie', $movie_args); } add_action('init', 'amy_movie_create_postype_movie', 12); } /* * Genre */ if (!function_exists('amy_movie_create_taxonomy_genre')) { function amy_movie_create_taxonomy_genre() { $permalinks = get_option('amy_movie_permalinks'); $genre_slug = isset($permalinks['genre_slug']) ? $permalinks['genre_slug'] : 'amy-genre'; $genre_rewire = array( 'slug' => $genre_slug, 'with_front' => true, 'hierarchical' => true, ); $labels = array( 'name' => esc_html__('سبک ها', 'amy-movie'), 'singular_name' => esc_html__('سبک', 'amy-movie'), 'search_items' => esc_html__('جستجوی سبک', 'amy-movie'), 'all_items' => esc_html__('همه سبک ها', 'amy-movie'), 'parent_item' => esc_html__('سبک مادر', 'amy-movie'), 'parent_item_colon' => esc_html__('سبک مادر:', 'amy-movie'), 'edit_item' => esc_html__('ویرایش سبک', 'amy-movie'), 'update_item' => esc_html__('به روزرسانی سبک', 'amy-movie'), 'add_new_item' => esc_html__('افزودن سبک جدید', 'amy-movie'), 'new_item_name' => esc_html__('نام سبک جدید', 'amy-movie'), 'menu_name' => esc_html__('سبک ها'), ); register_taxonomy('amy_genre',array('amy_movie'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => $genre_rewire, )); } add_action('init', 'amy_movie_create_taxonomy_genre', 12); } /* * actor */ if (!function_exists('amy_movie_create_taxonomy_actor')) { function amy_movie_create_taxonomy_actor() { $permalinks = get_option('amy_movie_permalinks'); $actor_slug = isset($permalinks['actor_slug']) ? $permalinks['actor_slug'] : 'amy-actor'; $actor_rewire = array( 'slug' => $actor_slug, 'with_front' => true, 'hierarchical' => true, ); $labels = array( 'name' => esc_html__('بازیگران', 'amy-movie'), 'singular_name' => esc_html__('بازیگر', 'amy-movie'), 'search_items' => esc_html__('جستجوی بازیگر', 'amy-movie'), 'all_items' => esc_html__('همه بازیگران', 'amy-movie'), 'edit_item' => esc_html__('ویرایش بازیگر', 'amy-movie'), 'update_item' => esc_html__('به روزرسانی بازیگر', 'amy-movie'), 'add_new_item' => esc_html__('افزودن بازیگر جدید', 'amy-movie'), 'new_item_name' => esc_html__('نام بازیگر جدید', 'amy-movie'), 'menu_name' => esc_html__('بازیگران'), ); register_taxonomy('amy_actor',array('amy_movie'), array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => $actor_rewire, )); } add_action('init', 'amy_movie_create_taxonomy_actor', 12); } /* * Director */ if (!function_exists('amy_movie_create_taxonomy_director')) { function amy_movie_create_taxonomy_director() { $permalinks = get_option('amy_movie_permalinks'); $director_slug = isset($permalinks['director_slug']) ? $permalinks['director_slug'] : 'amy-director'; $director_rewire = array( 'slug' => $director_slug, 'with_front' => true, 'hierarchical' => true, ); $labels = array( 'name' => esc_html__('کارگردان ها', 'amy-movie'), 'singular_name' => esc_html__('کارگردان', 'amy-movie'), 'search_items' => esc_html__('جستجوی کارگردان', 'amy-movie'), 'all_items' => esc_html__('همه کارگردان ها', 'amy-movie'), 'edit_item' => esc_html__('ویرایش کارگردان', 'amy-movie'), 'update_item' => esc_html__('به روزرسانی کارگردان', 'amy-movie'), 'add_new_item' => esc_html__('افزودن کارگردان جدید', 'amy-movie'), 'new_item_name' => esc_html__('نام کارگردان جدید', 'amy-movie'), 'menu_name' => esc_html__('کارگردان ها'), ); register_taxonomy('amy_director',array('amy_movie'), array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => $director_rewire, )); } add_action('init', 'amy_movie_create_taxonomy_director', 12); } /* * Cinema */ if (!function_exists('amy_movie_create_posttype_cinema')) { function amy_movie_create_posttype_cinema() { if (amy_get_option('enable_m_cinema', true) == false) { return; } $permalinks = get_option('amy_movie_permalinks'); $cinema_slug = ($permalinks['cinema_slug']) ? $permalinks['cinema_slug'] : 'amy-cinema'; $cinema_rewire = array( 'slug' => $cinema_slug, 'with_front' => true, 'hierarchical' => true, ); register_post_type('amy_cinema', array( 'labels' => array( 'name' => esc_html__('سینماها', 'amy-movie'), 'singular_name' => esc_html__('سینماها', 'amy-movie'), ), 'public' => true, 'has_archive' => true, 'menu-icon' => 'dashicons-building', 'supports' => array('title', 'editor', 'comments'), 'rewrite' => $cinema_rewire, ) ); } add_action('init', 'amy_movie_create_posttype_cinema', 12); }