Change column of row action (Quick Edit) links in WP_List_Table
Change column of row action (Quick Edit) links in WP_List_Table
Change column of row action (Quick Edit) links in WP_List_Table
If you use the comment_class function to add classes to each comment, comments by the post’s author can be styled via the bypostauthor class. You can alternately match the comment ID against the post ID: global $post; if( $comment->user_id === $post->post_author ) { // is author comment }
I think that using standard WP featurs there’s no shortcut. But you can workaround using a custom widget. As example create a very simple widget, something like: class MyPageWidget extends WP_Widget { function __construct() { parent::__construct( ‘MyPageWidget’, ‘My Page Widget’ ); } function widget( $args ) { $page = get_page_by_path(‘sidebar-page’); if ( ! empty($page) ) … Read more
pre_get_posts the right hook you need to use. function CPT_set_default_orderby($q){ global $pagenow, $typenow; if( is_admin() && ‘edit.php’ == $pagenow && ‘post’ == $typenow && !isset($_GET[‘orderby’]) ){ // to order by title $q->set(‘orderby’, ‘title’); // to orderby with meta key $q->set(‘orderby’, ‘meta_key’); $q->set(‘meta_key’, ‘expiration’); } } add_action(‘pre_get_posts’, ‘CPT_set_default_orderby’);
Add this to your functions.php in your theme folder: function restrict_post_deletion($post_ID){ $user = get_current_user_id(); $restricted_users = array(21,25,54,2,19); $restricted_pages = array(2,21,52,64); if(in_array($user, $restricted_users) && in_array($post_ID, $restricted_pages)){ echo “You are not authorized to delete this page.”; exit; } } add_action(‘wp_trash_post’, ‘restrict_post_deletion’, 10, 1); add_action(‘wp_delete_post’, ‘restrict_post_deletion’, 10, 1); Taken from here and updated to the latest WP version.
Admin blank but Admin menu showing
Unsure how to add simple checkboxes that write to a small table to admin
You have to insert the code in functions.php not in header.php. <?php function my_script(){ // put wp_enqueue_script here ?> <?php wp_enqueue_script(‘bjqs-1.3′, get_template_directory_uri().’/js/bjqs-1.3.js’); ?> <?php wp_enqueue_script(‘bjqs-1.3.min’, get_template_directory_uri().’/js/bjqs- 1.3.min.js’); ?> <?php wp_enqueue_style(‘bjqs’, get_template_directory_uri().’/bjqs.css’); ?> <?php //wp_enqueue_style(‘demo’, get_template_directory_uri().’/demo.css’); ?> <?php wp_enqueue_script(‘jquery.secret-source.min’, get_template_directory_uri().’/jquery.secret-source.min.js’); ?> <?php } add_action(‘wp_enqueue_scripts’, ‘my_script’); ?> See here for detail, http://codex.wordpress.org/Function_Reference/wp_enqueue_script.
How to sort post_meta in edit.php?
In this case, the issue is due to the queue order. You should change the priority of the execution of your add_action hook to something large, to ensure that it executes as late as possible. add_action‘s 3rd argument is the priority represented by an integer. Lower #’s gain priority in execution over higher #’s. add_action( … Read more