Make get_permalink() work outside the Loop using filters

I made an example plugin based on Milo’s answer to show how you can use ajax to get a post and display it with colorbox. example.php: <?php /* Plugin Name: example */ function example_ajax_get_post() { $url = $_POST[‘url’]; $post = get_post(url_to_postid($url)); ?> <h2><?php print $post->post_title; ?></h2> <div><?php print $post->post_content; ?></div> <?php die(); }// end function … Read more

wp_insert_user keeps echoing values

If you really narrowed it to line 1371 then you probably have a plugin hooking on those hooks and outputing that message, might even be your own code as it looks like somthing that supposed to be sent as a response to AJAX request. Just search for user_register and profile_update in your code and in … Read more

WordPress actions for plugin admin UI page

You may not have access to $_GET. I think you may need global $wpdb, $posts, $_GET; Second, everything happens in the constructor, which is when the plugin loads, which is every time any page of the site loads. So, every time a page loads you are checking $_GET[‘action’] for either ‘edit’ or ‘delete’. Those action … Read more

Custom Fields for Page Edits

Typically what plugin authors will do is use add_meta_box to add an area on the post edit screen for users to enter extra data. Within the functions that save and retrieve the data to generate your meta box, use the post meta functions to store it. Remember that prefixing a meta key with an underscore … Read more