Adding plugin settings link upon activation

Code extracted from my plugin, adapt as necessary. add_filter( ‘plugin_action_links’, ‘wpse_25030_settings_plugin_link’, 10, 2 ); function wpse_25030_settings_plugin_link( $links, $file ) { if ( $file == plugin_basename(dirname(__FILE__) . ‘/many-tips-together.php’) ) { /* * Insert the link at the beginning */ $in = ‘<a href=”https://wordpress.stackexchange.com/questions/25030/options-general.php?page=many-tips-together”>’ . __(‘Settings’,’mtt’) . ‘</a>’; array_unshift($links, $in); /* * Insert at the end */ … Read more

How to get the ID of the currently logged in user?

get_current_user_id() effectively does what @Giri had described in the first snippet. The internal WordPress function-call chain eventually calls get_currentuserinfo() which already checks if there is a WP_User object, meaning a user is logged in. Thus, from what I can see in the linked code, get_current_user_id() always returns the ID of the user that is logged … Read more

How to get the post content after WordPress post processing?

If by “post processing” you mean the autoformatting, the shortcode processing, that sort of thing, then you want to pass the content through the the_content filters. $my_id = 7; $post_id_7 = get_post($my_id); $post_content = $post_id_7->post_content; $post_content = apply_filters(‘the_content’,$post_content); http://codex.wordpress.org/Function_Reference/apply_filters You can see much of what will be applied by default by looking at the source … Read more