front end editing using iFrames, best approach?

Using a custom template and wp_update_post you should be able to build your own edit/add post pages in your sites frontend. There are also various plugins available that attempt to do similar things. iFrames can be done, but it will need some checks in functions.php to check for a get variable and add conditional stylesheets … Read more

wp_schedule_event only when admin is visited

In your event callback function check to see if the user id the admin then run the function else just reschedule it. So using the example from the codex’s page you linked in the question it would be something like this: function my_activation() { if ( !wp_next_scheduled( ‘my_hourly_event’ ) ) { wp_schedule_event(time(), ‘hourly’, ‘my_hourly_event’); } … Read more

Remove Admin sidebar link

function remove_featured_tax_menu() { remove_submenu_page( ‘edit.php?post_type=movies’, ‘edit-tags.php?taxonomy=featured&post_type=movies’ ); } add_action( ‘admin_menu’, ‘remove_featured_tax_menu’ );

How to restrict the editors from viewing/editing pages created by admin?

This code will do the job… <?php add_action(‘pre_get_posts’, ‘filter_posts_list’); function filter_posts_list($query) { //$pagenow holds the name of the current page being viewed, we want to run our code only on edit.php (posts list) global $pagenow; //If the ‘Editor’ is logged in, exclude ‘Admin’s posts if(current_user_can(‘editor’) && (‘edit.php’ == $pagenow)) { //global $query’s set() method for … Read more

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