Add link on the top menu of the post table?

They are filtered via the views_[screen-id] filter. The screen-id of the edit post page is edit-post, so you can modify the links like this: add_action( ‘views_edit-post’, ‘wpse17484_views_edit_post’ ); function wpse17484_views_edit_post( $views ) { $views[‘wpse17484’] = ‘<a href=”https://wordpress.stackexchange.com/questions/17484/my-url”>My action</a>’; return $views; } You can see the code that generates the post views in WP_Posts_List_Table::get_views().

How to add a custom button to the tinyMCE toolbar?

Your problem i believe are the lines that follow the enqueues and print scripts, you’re mixing Javascript with PHP.. Javascript goes inside the HTML section of a PHP file or inside an echo statement. This page of the codex gives an example for adding a button to TinyMCE inside WordPress. However that codex entry might … Read more

Change WordPress post-state in Admin Area

Your function doesn’t return a value, so you are effectively wiping the existing states. Also, this hook passes you the current post as an object, so you can use that instead of the global $post. Additionally get_page_templ‌​ate_slug returns a path that is relative to your theme’s root, so if your theme directory is called Lef-en-Liefde … Read more

Find most recent authors

Use a custom SQL query to grab the latest 16 post IDs with unique authors; $post_IDs = $wpdb->get_col( “SELECT ID FROM $wpdb->posts WHERE post_type=”product” AND post_status=”publish” GROUP BY post_author ORDER BY post_date DESC LIMIT 16″ ); Then start up a new query with the post__in argument; $recent_posts = new WP_Query( array( ‘post__in’ => $post_IDs, ‘post_type’ … Read more

Plugin for changing a post’s category based on it’s post date?

Don’t know of a plugin but you can use wp_schedule_single_event function. First create a meta box that takes to values: time for removal and what category we want to set it to when removed from featured. /* hook meta box */ add_action(“admin_init”, “admin_init”); /* hook meta box function */ function admin_init(){ add_meta_box(“Featured Removal”, “Featured Removal”, … Read more

How to disable edit post option after period of time?

Ok! @Kieran and @Rarst, here it is 🙂 function stoppostedition_filter( $capauser, $capask, $param){ global $wpdb; $post = get_post( $param[2] ); if( $post->post_status == ‘publish’ ){ // Disable post edit only for authore role if( $capauser[‘author’] == 1 ){ if( ( $param[0] == “edit_post”) || ( $param[0] == “delete_post” ) ) { // How much time … Read more

Forcing oembeds to top of post

you can create custom post meta which contain youtube url and then $yt=get_post_meta($post->ID,’youtube_url’,true); if( ” != $yt) echo $GLOBALS[‘wp_embed’]->autoembed( $yt ); Updated: If i’m getting correctly then your content contain youtube url any where in it and you want to show them at top regardless there position in content. jut paste this code in functions.php … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)