__( 'Category successfully created.', 'videopress-hq' ), 2 => __( 'Category successfully deleted.', 'videopress-hq' ), 3 => __( 'Category successfully updated.', 'videopress-hq' ), 4 => __( 'An error occurred while creating the category.', 'videopress-hq' ), 5 => __( 'An error occurred while updating the category.', 'videopress-hq' ), 6 => __( 'Categories successfully deleted.', 'videopress-hq' ), ); $get_error = (int) filter_input( INPUT_GET, 'error', FILTER_VALIDATE_INT ); $is_error_message = 1 === $get_error; $get_message = (int) filter_input( INPUT_GET, 'message', FILTER_VALIDATE_INT ); $displayed_message = $messages[ $get_message ] ?? ''; $categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => true, 'exclude' => array( 1 ), ) ); $hierarchical_categories = array(); foreach ( $categories as $category ) { if ( 0 === $category->parent ) { if ( ! isset( $hierarchical_categories[ $category->term_id ] ) ) { $hierarchical_categories[ $category->term_id ] = array( 'category' => $category, 'children' => array(), ); } else { $hierarchical_categories[ $category->term_id ]['category'] = $category; } } else { if ( ! isset( $hierarchical_categories[ $category->parent ] ) ) { $hierarchical_categories[ $category->parent ] = array( 'category' => null, 'children' => array(), ); } $hierarchical_categories[ $category->parent ]['children'][] = $category; } } uasort( $hierarchical_categories, function( $a, $b ) { return strcasecmp( $a['category']->name, $b['category']->name ); } ); $manage_categories_page_link = vphq_relative_admin_page_link( 'categories' ); $get_category_actions = function( $category ) use ( $manage_categories_page_link ) { return array( 'edit' => array( 'url' => admin_url( 'term.php?action=edit&post_type=vp_video&taxonomy=category&tag_ID=' . esc_attr( $category->term_id ) . '&wp_http_referer=' . $manage_categories_page_link ), 'text' => __( 'Edit', 'videopress-hq' ), ), 'view' => array( 'url' => get_category_link( $category ), 'text' => __( 'View', 'videopress-hq' ), ), 'delete' => array( 'url' => wp_nonce_url( vphq_get_admin_url( 'admin-ajax.php?action=videopress_hq_delete_category&category_id=' . esc_attr( $category->term_id ) ), 'videopress_hq_delete_category-' . $category->term_id ), 'text' => __( 'Delete', 'videopress-hq' ), 'classname' => 'delete-category', ), ); } ?>
name ); ?> > | description ); ?> | slug ); ?> | count ); ?> |
- name ); ?> > | description ); ?> | slug ); ?> | count ); ?> |