Carbon Admin Columns Manager
This plugin provides an easy way to add, remove and manage columns from WordPress administration screens for post, users and taxonomy listing., (*1)
Usage
Modify pages list columns
Remove date and author columns from page listing screen, and add 2 extra columns (color
and view count
). The values for the extra columns are fetched from certain post meta fields., (*2)
Code:, (*3)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->remove( array('date', 'author') )
->add( array(
Carbon_Admin_Column::create('Color')
->set_field('color'),
Carbon_Admin_Column::create('Views Count')
->set_field('views_count'),
));
Print column values with callback function
Add an extra column to page listing screen: views. Every page with more than 1000 views is rendered with a special CSS class popular-page
., (*4)
This is achieved by using a custom callback function for printing the content of the column for the particular post_id
., (*5)
Code:, (*6)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->add( array(
Carbon_Admin_Column::create('Views Count')
->set_callback('crb_admin_render_view_count_col'),
));
function crb_admin_render_view_count_col( $post_id ) {
$views_count = get_post_meta($post_id, 'views_count', 1);
$views_count = intval($views_count);
if ($views_count > 1000) {
$views_count = '<span class="popular-page">' . $views_count . '</span>';
}
return $views_count;
}
Modify custom post type columns
Remove date and author columns from the crb_cars
custom post type listing screen, and add 2 extra columns (model
and price
). The values for the extra columns are fetched from certain post meta fields., (*7)
Code:, (*8)
Carbon_Admin_Columns_Manager::modify_columns('post', array('crb_cars') )
->remove( array('date', 'author') )
->add( array(
Carbon_Admin_Column::create('Model')
->set_field('_crb_car_model'),
Carbon_Admin_Column::create('Price')
->set_field('_crb_car_price'),
));
Render featured image in the listing table, (*9)
To show the featured image for the post
, page
and crb_cars
post types, use a custom callback function that accepts the $post_id
as a parameter., (*10)
Code:, (*11)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page', 'post', 'crb_cars') )
->add( array(
Carbon_Admin_Column::create('Thumbnail')
->set_callback('crb_column_render_post_thumbnail'),
));
function crb_column_render_post_thumbnail( $post_id ) {
if ( has_post_thumbnail( $post_id ) ) {
$thumbnail = get_the_post_thumbnail( $post_id, 'my_backend_image_size' );
} else {
$thumbnail = '';
}
return $thumbnail;
}
Modify taxonomy columns, (*12)
Remove slug and count columns from categories and tags listing screens, and add 2 extra columns (image
and subtitle
). The values for the extra columns are fetched from certain term meta fields.
Showing the term image is achieved by using a custom callback function and showing the term subtitle is achieved by using the field meta key., (*13)
Code:, (*14)
Carbon_Admin_Columns_Manager::modify_columns('taxonomy', array('category', 'post_tag') )
->remove( array('description', 'posts') )
->add( array(
Carbon_Admin_Column::create('Subtitle')
->set_field('crb_term_subtitle'),
Carbon_Admin_Column::create('Image')
->set_callback('crb_column_render_term_image'),
));
function crb_column_render_term_image( $term_id ) {
if ( $term_image_id = carbon_get_term_meta( $term_id, 'crb_term_image' ) ) {
$term_image = wp_get_attachment_image( $term_image_id, 'my_backend_image_size' );
} else {
$term_image = '';
}
return $term_image;
}
Modify user columns, (*15)
Remove posts, role and e-mail columns from users listing screen, and add 2 extra columns (is user active
and user registration date
). The values for the extra columns are fetched from user meta fields.
Showing the user status (active / inactive) is achieved by using the field meta key, while showing the user registration date is achieved by using a custom callback function., (*16)
Code:, (*17)
Carbon_Admin_Columns_Manager::modify_columns('user')
->remove( array('email', 'role', 'posts') )
->add( array(
Carbon_Admin_Column::create('Is Active')
->set_field('crb_user_status'),
Carbon_Admin_Column::create('Registration Date')
->set_callback('crb_column_get_user_registration_date'),
));
function crb_column_get_user_registration_date( $user_id ) {
$user = get_user_by( 'id', $user_id );
$user_registration_date = $user->data->user_registered;
$friendly_date_text = date( 'd F, Y', strtotime( $user_registration_date ) );
return $friendly_date_text;
}
How to deal with the responsive version of the WordPress admin, (*18)
By default WordPress hides all additional columns when the device width is equal or less than 800 pixels.
However, the unnecessary columns can be removed or their values can be combined into a single column by using a callback function., (*19)
The example below removes the date
, author
and comments
columns from page listing screen, and adds a single column showing the author
, comments
, date
and thumbnail
.
In this example we will use the regular post function to retrieve the information. Each column will display the post data that corresponds to the listed entry., (*20)
Code:, (*21)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->remove( array('date', 'author', 'comments') )
->add( array(
Carbon_Admin_Column::create('Page Information')
->set_callback('crb_column_page_information'),
) );
function crb_column_page_information( $page_id ) {
ob_start();
?>
<ul>
<?php if ( has_post_thumbnail() ): ?>
<li>
<?php the_post_thumbnail( 'thumbnail' ) ?>
</li>
<?php endif ?>
<li>
Posted on : <?php the_time('F jS, Y ') ?>
</li>
<li>
<?php printf(__('Posted by : %s', 'crb'), get_the_author()) ?>
</li>
<li>
<?php comments_popup_link( __('No Comments', 'crb'), __('1 Comment', 'crb'), __('% Comments', 'crb') ); ?>
</li>
</ul>
<?php
$page_information_content = ob_get_clean();
return $page_information_content;
}
Create a sortable column in the WordPress admin, (*22)
Create a sortable column on page listing screen that sorts the pages by their views count., (*23)
Code:, (*24)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->add( array(
Carbon_Admin_Column::create('Page Information')
->set_sort_field('views_count'), # that value will be accessible as 'orderby' get parameter.
->set_callback('crb_column_page_information'),
) );
add_action('pre_get_posts', 'crb_sort_pages_by_their_views_count');
function crb_sort_pages_by_their_views_count( $query ) {
if (
is_admin()
&& $query->is_main_query()
&& get_query_var( 'post_type' )==='page'
&& !empty( $_GET['orderby'] )
&& $_GET['orderby']==='orderby_custom_column'
) {
$query->set('orderby', 'meta_value_num');
$query->set('meta_key', '_crb_page_views');
}
return $query;
}
Create a sortable column on user listing screen that sorts the users by their status (active / inactive)., (*25)
Code:, (*26)
Carbon_Admin_Columns_Manager::modify_columns('user')
->add( array(
Carbon_Admin_Column::create('Is User Active')
->set_field('_crb_is_user_active')
->set_sort_field('orderby_status'),
) );
add_action( 'pre_get_users', 'crb_pre_user_query' );
function crb_pre_user_query( $user_query ) {
global $wpdb;
if (
is_admin()
&& !empty($_GET['orderby'])
&& $_GET['orderby']==='orderby_status'
) {
$user_query->set('meta_key', '_crb_is_user_active');
$user_query->set('orderby', 'meta_value');
}
}
Set custom width to a column in the WordPress admin, (*27)
Set different width to Color, Views Count and Status columns for the page listing screen. Color column width is in percents while the View Count column width is in pixels. The width for the Status column is passed as an integer, which will automatically treat it as a pixel value., (*28)
Code:, (*29)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->remove( array('date', 'author') )
->add( array(
Carbon_Admin_Column::create('Color')
->set_width( '80%' )
->set_field('color'),
Carbon_Admin_Column::create('Views Count')
->set_width( '25px' )
->set_field('views_count'),
Carbon_Admin_Column::create('Status')
->set_width( 100 )
->set_field('status'),
));
Please, note that WordPress administration is responsive and you should use a reasonable number of columns, as well as reasonable width for each one of them. For example, having a column width of 600 pixels might cause issues on mobile devices., (*30)
How to set custom column name and to add specific style to it?, (*31)
By default the column names are generated randomly unless custom name is specified., (*32)
Setting up custom name for Image column on page listing screen and setting maximum image width., (*33)
Code:, (*34)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->remove( array('date', 'author') )
->add( array(
Carbon_Admin_Column::create('Color')
->set_name( 'crb-column-page-thumbnail' )
->set_width( '100px' )
->set_field('color'),
));
CSS:, (*35)
<style type="text/css">
/* column heading */
#carbon-crb-column-page-thumbnail {
font-weight : bold;
}
/* column value */
.crb-column-page-thumbnail img {
max-width : 100%;
height : auto;
}
</style>
How to reorder the columns on the admin listing screeen?, (*36)
Moving page thumbnail column between the post checkbox and title columns. It's required that you set a column name with set_name()
and then to specify the new order with sort()
. All columns that are not specified in the array that you pass to the sort()
method will be moved to the end, keeping their default order., (*37)
Code:, (*38)
Carbon_Admin_Columns_Manager::modify_columns('post', array('page') )
->sort( array('cb', 'crb-thumbnail-column') )
->add( array(
Carbon_Admin_Column::create('Thumbnail')
->set_name( 'crb-thumbnail-column' )
->set_callback('crb_column_thumbnail'),
));
Useful Callback Functions
The functions below are just for reference and are not defined in the plugin., (*39)
Page/Post Thumbnail
Use the following callback function to display the post thumbnail photo., (*40)
Code :, (*41)
function crb_column_thumbnail( $post_id ) {
if ( has_post_thumbnail( $post_id ) ) {
return get_the_post_thumbnail( $post_id, 'admin_thumbnails' );
}
}
Page Template
Use the following callback function to display the page template name., (*42)
Code :, (*43)
function crb_column_page_template( $page_id ) {
$page_template_name = array_search(
get_post_meta( $page_id, '_wp_page_template', true ),
get_page_templates()
);
if ( $page_template_name === false ) {
$page_template_name = 'Default';
}
return $page_template_name;
}
Page Sidebar
Use the following callback function to display the sidebar that is selected for each page., (*44)
Code :, (*45)
function crb_column_page_template( $page_id ) {
$sidebar = get_post_meta( $page_id, 'crb_custom_sidebar', true );
if ( empty($sidebar) ) {
$sidebar = 'Default Sidebar';
}
return $page_template_name;
}
Package Summary
Columns Manager
There are three types of manager for Posts, Taxonomies and Users listing pages., (*46)
Posts Manager, (*47)
Code :, (*48)
$post_types = array( 'post_type_one', 'post_type_two' );
$columns_to_remove = array( 'column_one', 'column_two' );
$custom_column_order = array( 'column_name_five', 'column_name_four', 'column_name_three' );
$columns_to_add = array( $columns_code_goes_here );
Carbon_Admin_Columns_Manager::modify_columns('post', $post_types )
->remove( $columns_to_remove ) # remove unnecessary columns
->sort( $custom_column_order ) # set custom column order
->add( $columns_to_add ) # add new columns
Taxonomy Manager, (*49)
Code :, (*50)
$taxonomies = array( 'taxonomy_name_one', 'taxonomy_name_two' );
$columns_to_remove = array( 'column_one', 'column_two' );
$custom_column_order = array( 'column_name_five', 'column_name_four', 'column_name_three' );
$columns_to_add = array( $columns_code_goes_here );
Carbon_Admin_Columns_Manager::modify_columns('taxonomy', $taxonomies )
->remove( $columns_to_remove ) # remove unnecessary columns
->sort( $custom_column_order ) # set custom column order
->add( $columns_to_add ) # add new columns
Users Manager, (*51)
Code :, (*52)
$columns_to_remove = array( 'column_one', 'column_two' );
$custom_column_order = array( 'column_name_five', 'column_name_four', 'column_name_three' );
$columns_to_add = array( $columns_code_goes_here );
Carbon_Admin_Columns_Manager::modify_columns('user')
->remove( $columns_to_remove ) # remove unnecessary columns
->sort( $custom_column_order ) # set custom column order
->add( $columns_to_add ) # add new columns
Column, (*53)
Column that lists meta value by a given meta key, (*54)
Code :, (*55)
$column_name = __('My Column Name', 'crb');
$meta_key = '_crb_meta_key';
Carbon_Admin_Column::create( $column_name )
->set_field( $meta_key ),
Column that prints its value through callback function, (*56)
Code :, (*57)
$column_name = __('My Column Name', 'crb');
$callback_function_name = 'crb_callback_function';
Carbon_Admin_Column::create( $column_name )
->set_callback( $callback_function_name ),
/**
* Callback Function
*
* @param $object_id Post ID, Term ID or User Id according to the Manager
*/
function crb_callback_function( $object_id ) {
# posts
return get_post_meta( $object_id, '_crb_meta_key', true );
# terms
return carbon_get_term_meta( $object_id, '_crb_meta_key' );
# users
return get_user_meta( $object_id, '_crb_meta_key', true );
}
Available Column Functions, (*58)
-
::create( $param )
, string, column label
-
set_field( $param )
, string, meta key, cannot be used along with set_callback()
-
set_callback( $param )
, string, callback function name, cannot be used along with set_field()
-
set_name( $param )
, string, unque column name that can be used for column sorting or styling. by default the column name is generated randomly
-
set_sort_field( $param )
, string, $_GET['orderby']
value
Code :, (*59)
Carbon_Admin_Column::create( $column_label )
->set_field( $meta_key )
->set_callback( $callback_function_name )
->set_name( $column_name )
->set_sort_field( $crb_sorting_value )
FAQ
Π’ΡΡΠ±Π²Π° Π»ΠΈ Π΄Π° Π²ΠΊΠ»ΡΡΠ° Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΡΠ°, Π·Π° Ρ ΠΏΠΎΠ»Π·Π²Π°ΠΌ?
ΠΠ° Π²ΡΠΈΡΠΊΠΈ Π½ΠΎΠ²ΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠΈ ΡΠ°Π·ΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ° ΡΠ΅ Π±ΡΠ΄Π΅ ΡΠ°ΡΡ ΠΎΡ lib ΠΏΠ°ΠΏΠΊΠ°ΡΠ°. ΠΠ° ΠΏΠΎ-ΡΡΠ°ΡΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠΈ ΡΠ΅ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π΄Π° Ρ ΠΏΠΎΠ»Π·Π²Π°ΡΠ΅ ΡΠ»Π΅Π΄ ΠΈΠ·ΠΏΡΠ»Π½Π΅Π½ΠΈΠ΅ Π½Π° drone upgrade-lib Π² ΠΏΡΠΎΠ΅ΠΊΡΠ° ΡΠΈ, ΠΊΠ°ΡΠΎ ΡΠ΅ ΡΡΡΠ±Π²Π° ΡΡΡΠ½ΠΎ Π΄Π° Π΄ΠΎΠ±Π°Π²ΠΈΡΠ΅ ΡΠ°ΠΉΠ»Π° Π·Π° ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅ Π² /options ΠΈ Π΄Π° Π³ΠΎ include-Π½Π΅ΡΠ΅ Π²ΡΠ² functions.php., (*60)
ΠΠΌΠ° Π»ΠΈ ΠΎΡΠΎΠ±Π΅Π½ΠΎΡΡ ΠΏΡΠΈ ΠΈΠ·ΠΏΠΎΠ»Π·Π²Π°Π½Π΅ Π½Π° Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΡΠ° Π² ΠΏΠ»ΡΠ³ΠΈΠ½ΠΈ ΠΈΠ»ΠΈ Π² Π΄ΡΡΠ³ΠΈ ΡΠ΅ΠΌΠΈ?
ΠΠ΅Π»Π°ΡΠ΅Π»Π½ΠΎ Π΅ ΠΏΡΠΈ Π²ΠΌΡΠΊΠ²Π°Π½Π΅ΡΠΎ Π½Π° Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΡΠ° Π΄Π° ΠΏΡΠΎΠ²Π΅ΡΡΠ²Π°ΡΠ΅ Π΄Π°Π»ΠΈ Π²Π΅ΡΠ΅ Π½Π΅ ΡΠ΅ Π²ΠΌΡΠΊΠ²Π° ΠΎΡ ΠΏΠ»ΡΠ³ΠΈΠ½ ΠΈΠ»ΠΈ ΠΎΡ ΡΠ΅ΠΌΠ°ΡΠ° Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° Π·Π° Π²Π΅ΡΠ΅ Π²ΠΌΡΠΊΠ½Π°ΡΠ° Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ° Ρ class_exists
., (*61)
Code :, (*62)
if ( !class_exists(Carbon_Admin_Columns_Manager) ) {
include_once( PATH_TO_LIBRARY . 'carbon-admin-columns-manager.php');
}
ΠΠΌΠ° Π»ΠΈ ΠΎΠ³ΡΠ°Π½ΠΈΡΠ΅Π½ΠΈΠ΅ Π² Π±ΡΠΎΡΡ Π½Π° ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅?
ΠΠ³ΡΠ°Π½ΠΈΡΠ΅Π½ΠΈΠ΅ ΠΎΡ ΡΡΡΠ°Π½Π° Π½Π° ΠΊΠΎΠ΄Π° Π½ΡΠΌΠ°, ΡΠ°Π·Π±ΠΈΡΠ° ΡΠ΅, Π½Π΅ Π΅ Ρ
ΡΠ±Π°Π²ΠΎ Π΄Π° ΡΠ΅ Π·Π»ΠΎΡΠΏΠΎΡΡΠ΅Π±ΡΠ²Π° ΠΈ Π²ΠΈΠ½Π°Π³ΠΈ ΡΡΡΠ±Π²Π° Π΄Π° ΡΠ΅ ΠΏΡΠΎΠ²Π΅ΡΡΠ²Π° ΠΊΠ°ΠΊ ΡΠ΅ Π΄ΡΡΠΆΠ°Ρ ΠΏΡΠΈ ΠΏΠΎ-Π½ΠΈΡΠΊΠΈ ΡΠ΅Π·ΠΎΠ»ΡΡΠΈΠΈ., (*63)
ΠΠΎΠ³Π° Π»ΠΈ Π΄Π° Π·Π°Π΄Π°ΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π° ΡΠΈΡΠΈΠ½Π° Π½Π° ΠΊΠΎΠ»ΠΎΠ½Π°ΡΠ°?
ΠΡΠ·ΠΌΠΎΠΆΠ½ΠΎ Π΅ Π·Π°Π΄Π°Π²Π°Π½Π΅ Π½Π° ΡΠΈΡΠΈΠ½ΠΈ Π² ΠΏΠΈΠΊΡΠ΅Π»ΠΈ ΠΈ Π² ΠΏΡΠΎΡΠ΅Π½ΡΠΈ. ΠΠΏΠΈΡΠ°Π½ΠΎ Π΅ Π² ΠΏΡΠΈΠΌΠ΅Ρ ΠΏΠΎ-Π³ΠΎΡΠ΅., (*64)
ΠΠ°ΠΊ ΠΌΠΎΠ³Π° Π΄Π° ΡΡΠΈΠ»Π²Π°ΠΌ ΡΡΠ΄ΡΡΠΆΠ°Π½ΠΈΠ΅ΡΠΎ Π½Π° ΠΊΠΎΠ»ΠΎΠ½Π°ΡΠ°?
ΠΠ΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ Π΅ Π΄Π° ΡΠ΅ Π·Π°Π΄Π°Π΄Π΅ ΡΠ½ΠΈΠΊΠ°Π»Π½ΠΎ ΠΈΠΌΠ΅ Π½Π° ΠΊΠΎΠ»ΠΎΠ½Π°ΡΠ° ΡΠ»Π΅Π΄, ΠΊΠΎΠ΅ΡΠΎ Π΅ Π²ΡΠ·ΠΌΠΎΠΆΠ½ΠΎ Π½Π΅ΠΉΠ½ΠΎΡΠΎ ΡΡΠΈΠ»Π²Π°Π½Π΅ ΠΏΠΎ ΠΈΠΌΠ΅. ΠΠΏΠΈΡΠ°Π½ΠΎ Π΅ Π² ΠΏΡΠΈΠΌΠ΅Ρ ΠΏΠΎ-Π³ΠΎΡΠ΅., (*65)
ΠΠΎΠ³Π° Π»ΠΈ Π΄Π° ΠΏΡΠΎΠΌΠ΅Π½ΡΠΌ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° Π½Π° Π²Π΅ΡΠ΅ ΡΡΡΠ΅ΡΡΠ²ΡΠ²Π°ΡΠ° ΠΊΠΎΠ»ΠΎΠ½Π°?
ΠΠ° ΠΌΠΎΠΌΠ΅Π½ΡΠ° Π½Π΅ Π΅ Π²ΡΠ·ΠΌΠΎΠΆΠ½ΠΎ, ΡΡΠΉ ΠΊΠ°ΡΠΎ post/taxonomy ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅ ΠΏΡΠΈΠ½ΡΠΈΡΠ°Ρ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° ΠΈ Π±Π΅Π· 'Ρ
Π°ΠΊΠ°Π½Π΅' Π½Π΅ ΠΌΠΎΠΆΠ΅ Π΄Π° ΡΡΠ°Π½Π΅ ΠΏΠΎ Ρ
ΡΠ±Π°Π² Π½Π°ΡΠΈΠ½., (*66)
ΠΠ°ΡΠΎ ΠΊΠΎΠ»ΠΎΠ½Π°ΡΠ° Π²ΡΡΡΠ° ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° Π½Π°Π΄ ΡΠ°Π±Π»ΠΈΡΠ°ΡΠ°?
Π’ΠΎΠ·ΠΈ ΠΏΡΠΎΠ±Π»Π΅ΠΌ Π²ΡΠ·Π½ΠΈΠΊΠ²Π° ΡΠ°ΠΌΠΎ ΠΏΡΠΈ ΠΏΠΎΡΡΠ΅Π±ΠΈΡΠ΅Π»ΡΠΊΠΈΡΠ΅ ΠΊΠΎΠ»ΠΎΠ½ΠΈ, ΠΊΠΎΠ³Π°ΡΠΎ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° Π½Π° callback ΡΡΠ½ΠΊΡΠΈΡΡΠ° ΡΠ΅ ΠΏΡΠΈΠ½ΡΠΈΡΠ° echo
.
ΠΠ΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ Π΅ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° Π΄Π° ΡΠ΅ Π²ΡΡΡΠ° return
., (*67)
ΠΠΎΠ³Π° Π»ΠΈ Π΄Π° ΠΏΡΠΎΠΌΠ΅Π½ΡΠΌ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° Π½Π° Π²Π΅ΡΠ΅ ΡΡΡΠ΅ΡΡΠ²ΡΠ²Π°ΡΠ° ΠΊΠΎΠ»ΠΎΠ½Π°?
ΠΠ° ΠΌΠΎΠΌΠ΅Π½ΡΠ° Π½Π΅ Π΅ Π²ΡΠ·ΠΌΠΎΠΆΠ½ΠΎ, ΡΡΠΉ ΠΊΠ°ΡΠΎ post/taxonomy ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅ ΠΏΡΠΈΠ½ΡΠΈΡΠ°Ρ ΡΡΠΎΠΉΠ½ΠΎΡΡΡΠ° ΠΈ Π±Π΅Π· 'Ρ
Π°ΠΊΠ°Π½Π΅' Π½Π΅ ΠΌΠΎΠΆΠ΅ Π΄Π° ΡΡΠ°Π½Π΅ ΠΏΠΎ Ρ
ΡΠ±Π°Π² Π½Π°ΡΠΈΠ½., (*68)
ΠΡΠΊΠ°ΠΌ Π΄Π° ΠΏΡΠ΅ΠΌΠ°Ρ
Π½Π° ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π° ΠΊΠΎΠ»ΠΎΠ½Π°, Π½ΠΎ Π½Π΅ ΠΈ Π·Π½Π°ΠΌ ΠΈΠΌΠ΅ΡΠΎ. ΠΡΠΊΡΠ΄Π΅ ΠΌΠΎΠ³Π° Π΄Π° Π³ΠΎ Π²ΠΈΠ΄Ρ?
ΠΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΎ ΡΠΎ Π΅ ID-ΡΠΎ ΠΊΠΎΠ»ΠΎΠ½Π°ΡΠ°. ΠΠΎΠΆΠ΅ Π΄Π° ΡΠ΅ ΠΏΡΠΎΠ²Π΅ΡΠΈ Ρ browser dev tool-Π°., (*69)
ΠΠΎΠ³Π° Π»ΠΈ Π΄Π° ΠΈΠ·ΠΏΠΎΠ»Π·Π²Π°ΠΌ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΡΠ° Π½Π° ΠΌΡΠ»ΡΠΈΠ΅Π·ΠΈΡΠ΅Π½ ΡΠ°ΠΉΡ?
Π Π°Π·Π±ΠΈΡΠ° ΡΠ΅., (*70)
ΠΠΌΠ° Π»ΠΈ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π° ΡΡΡΡΠΊΡΡΡΠ° ΠΏΡΠΈ ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΠ°Π½Π΅ Π½Π° ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅?
ΠΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π° ΡΡΡΡΠΊΡΡΡΠ° Π½ΡΠΌΠ°. ΠΠΎ Π°Π²ΡΠΎΡΡΠΊΠΎ ΠΌΠ½Π΅Π½ΠΈΠ΅ Π±ΠΈ Π±ΠΈΠ»ΠΎ ΠΆΠ΅Π»Π°ΡΠ΅Π»Π½ΠΎ Π΄Π° ΡΠ΅ ΡΠ»Π΅Π΄Π²Π° ΡΠ»Π΅Π΄Π½ΠΈΡ ΠΌΠΎΠ΄Π΅Π»:, (*71)
Code :, (*72)
if ( !class_exists('Carbon_Admin_Columns_Manager') ) {
return;
}
add_action( 'init', 'crb_admin_columns' );
function crb_admin_columns(){
// columns code goes here
}
ΠΠΎΠ³Π° Π»ΠΈ Π΄Π° ΡΠΎΡΡΠΈΡΠ°ΠΌ ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅ Π² ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ ΡΠ΅Π΄?
ΠΡΠ·ΠΌΠΎΠΆΠ½ΠΎ Π΅ ΠΏΡΠ΅Π½Π°ΡΠ΅ΠΆΠ΄Π°Π½Π΅ Π½Π° ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅ ΠΊΠ°ΡΠΎ ΠΊΠΎΠ»ΠΎΠ½ΠΈΡΠ΅, ΠΊΠΎΠΈΡΠΎ Π½Π΅ ΡΠ° Π·Π°Π΄Π°Π΄Π΅Π½ΠΈ Π² ΠΌΠ°ΡΠΈΠ²Π° ΠΎΡ ΠΊΠΎΠ»ΠΎΠ½ΠΈ ΡΠ΅ Π±ΡΠ΄Π°Ρ ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈ. ΠΡΠΈΠΌΠ΅ΡΡΡ Π΅ ΠΎΠΏΠΈΡΠ°Π½ ΠΏΠΎ-Π³ΠΎΡΠ΅., (*73)