Build Form on Dashboard

After did many trials and errors, finally I found the answer. Just in case anyone wondering how this working, I put the full code right here : /* == THEME OPTIONS == */ add_action(“admin_menu”, “setup_theme_admin_menus”); function setup_theme_admin_menus() { add_submenu_page(‘themes.php’, ‘Generate Coupons’, ‘Generate Coupons’, ‘manage_options’, ‘generate-coupons-elements’, ‘theme_generate_coupons_settings’); } function theme_generate_coupons_settings() { ?> <div class=”wrap”> <?php screen_icon(‘themes’); … Read more

display wordpress user who published a pending post of another user

get_the_modified_author(); isn’t going to tell you who published the post, just who last edited it. You will need to capture you publisher yourself. function post_published_notification( $ID, $post ) { $publisher = wp_get_current_user(); update_post_meta($ID,’my_publisher’,$publisher); } add_action( ‘publish_post’, ‘post_published_notification’, 10, 2 ); Then use get_post_meta($post_id,’my_publisher’) to retrieve the data. Of course there are a numerous ways to … Read more

Adding options to loop

You can use the add_meta_boxes hook to place a text field in the desired pages. Then on the template page you can check whether the user has entered some categories (display all categories if not) and filter the loop using the WP_Query, query_posts() or get_posts(). Here is an excellent article on the three methods.

WordPress Dashboard organize posts based on categories

you could use restrict_manage_posts to add a dropdown field to the admin bar. however this code needs refining, because terms are not presented hierarchical atm. add_action( ‘restrict_manage_posts’, ‘my_restrict_manage_posts’ ); function my_restrict_manage_posts() { global $typenow; $taxonomy = ‘your_taxonomy_name’; if( $typenow != “page” && $typenow != “post” ){ $filters = array($taxonomy); foreach ($filters as $tax_slug) { $tax_obj … Read more

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