How to auto empty comment trash after X days

When deleting a comment it’s possible to use the second input argument: wp_delete_comment( $comment, $force_delete = true ) to delete it permanently and avoiding the trash bin. You could try to adjust your scheduled script accordingly. There’s also the EMPTY_TRASH_DAYS constant, that’s default set to empty the trash bin after 30 days, but it will … Read more

Posting Instagram Photos Automatically

You’ll probably have to do your own integration, but here’s how I would approach it: Grab an Instagram PHP wrapper: http://www.mauriciocuenca.com/blog/2011/02/instagram-api-implementation-in-php/ OR http://instaphp.com OR https://github.com/cosenary/Instagram-PHP-API Authenticate via an admin option page Iterate through your user images using the /users/self/feed method Use the media_sideload_image() function found in wp-admin/includes/media.php to download the images Keep a running cache … Read more

How to incorporate Documentation into wordpress?

WordPress allows you to add help tabs which appear in your Dashboard and on each admin page. $screen = get_current_screen(); $screen->add_help_tab( array( ‘id’ => $id, //unique id for the tab ‘title’ => $title, //unique visible title for the tab ‘content’ => $content, //actual help text ‘callback’ => $callback //optional function to callback ) ); APIGen … Read more

Auto create post title in admin

the_title filter filters the existing title when it’s output on the front end. If you want to set a title when a post is created on the back end, you want to use the title_save_pre filter: function wpa65253_time_title( $title ) { global $post; if ( isset( $post->ID ) ) : if ( empty( $_POST[‘post_title’] ) … Read more

Auto add content such as pages upon plugin activation?

You can add those without a button: register_activation_hook( __FILE__, ‘my_plugin_install_function’); function my_plugin_install_function() { //post status and options $post = array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’ , ‘post_author’ => 1, ‘post_date’ => date(‘Y-m-d H:i:s’), ‘post_name’ => ‘Checklists’, ‘post_status’ => ‘publish’ , ‘post_title’ => ‘Checklists’, ‘post_type’ => ‘page’, ); //insert page and save the id $newvalue … Read more

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