How to make ajax call in wordpress in right way?

Your ajax hook add_action(‘wp_ajax_load_user_feed’, ‘ajax_load_user_feed’); is for logged in users only, if you want none logged in users (guests or visitors) then add: add_action(‘wp_ajax_nopriv_load_user_feed’, ‘ajax_load_user_feed’); and you should be fine.

How to add some custom HTML to the edit posts page

As found here: http://codex.wordpress.org/Function_Reference/add_meta_box /** * Calls the class on the post edit screen */ function call_someClass() { return new someClass(); } if ( is_admin() ) add_action( ‘load-post.php’, ‘call_someClass’ ); /** * The Class */ class someClass { const LANG = ‘some_textdomain’; public function __construct() { add_action( ‘add_meta_boxes’, array( &$this, ‘add_some_meta_box’ ) ); } /** … Read more

Filter Custom Post Type in Admin

Just like in Adding a Taxonomy Filter to Admin List for a Custom Post Type? the filter parse_query could be used, but here I’m using posts_where. The row All | Published | … is controlled by views_edit-{$post_type} and the $views array contains each item that’s a simple anchor tag. First, we insert a couple of … Read more

wp_list_table search box does not show

You must use $list_obj->prepare_items() before $list_obj->search_box(‘Search’, ‘search’) function! Example: <form method=”post”> <input type=”hidden” name=”page” value=”<?php echo $_REQUEST[‘page’]; ?>” /> <?php $this->sales_obj->prepare_items(); $this->sales_obj->search_box(‘Search’, ‘search’); $this->sales_obj->display(); ?> </form>

How to add custom columns to Custom Post Type admin screen

The code from ThinkVitamin is right. I think the problem came from else where in your code. Actually, the hook manage_edit-${post_type}_columns takes an argument $columns which is an array of all registered columns. To add a new column, just add a new element to this array, like this: add_filter(‘manage_edit-film_columns’, ‘my_columns’); function my_columns($columns) { $columns[‘views’] = … Read more

White screen of death only in wp-admin

As a rule of thumb, always remove the ending ?> of your .php files, especially if it’s a functions or config file that gets parsed before headers are sent to the page. If after that ?> you accidentally add a space, a tab character or a new line, there’s your invisible error.

Edit specific nodes in WP_Admin_Bar

Yes I recently ran into the situation where I wanted to change the profile link in the user-info section of the admin bar. The problem is that you can only get all nodes, add and remove them. Not edit. And you also cannot modify the $wp_admin_bar->nodes property due it is private. When easily removing and … Read more

Exclude drafts in all() view of edit.php

The show_in_admin_all_list parameter in the register_post_status() function, determines if a given post status is included in the All post table view. Probably the shortest version is: add_action( ‘init’, function() use ( &$wp_post_statuses ) { $wp_post_statuses[‘draft’]->show_in_admin_all_list = false; }, 1 ); but let’s avoid modifying the globals directly like this and override the default draft status … Read more