Can I hide only one category from admin post list?
function posts_for_current_author($query) { global $pagenow; if( ‘edit.php’ != $pagenow || !$query->is_admin ) return $query; else { $query->set(‘cat’, “-11”); } return $query; }
function posts_for_current_author($query) { global $pagenow; if( ‘edit.php’ != $pagenow || !$query->is_admin ) return $query; else { $query->set(‘cat’, “-11”); } return $query; }
Ok. So the only way that I found to do this is wrap the WordPress table in a custom meta box. This is not ideal, because I would like to see the table span the entire container, but it works.
This sounds like a Folder Permissions problems – the MAMP Apache user needs to have read/write privileges on everything under your Sites/wordpress/ folder. This is easy to do from the terminal … my post on Permissions should help can i run wp as root permissions
I fixed it by bypassing the script.
$gear = get_post_meta( $post_id, ‘gear’, true ); … will return the last value only, because you told it do that with the last parameter. Drop it, and you will get an array of all values: $gear = get_post_meta( $post_id, ‘gear’ ); Then print it with: print join( $gear, ‘, ‘ ); And as Chip has … Read more
Add this code where it’s should be (plugin/functions.php/mu-plugin) – simple “hide” method using css. add_action(‘admin_print_styles-post.php’, ‘hide_publishing_block_using_css’); add_action(‘admin_print_styles-post-new.php’, ‘hide_publishing_block_using_css’); function hide_publishing_block_using_css(){ echo ‘<style>#misc-publishing-actions{display:none;}</style>’; }
get_currentuserinfo(); if ( $current_user->ID === <ID of user to isolate>) { // user specific code } http://codex.wordpress.org/Function_Reference/get_currentuserinfo That is a very general solution. There may be other/better solutions but you didn’t provide much information about what you are trying to accomplish.
Solved: It appears chrome had a corrupt cache as I attempted to visit the backend on Firefox and noticed that the issue wasn’t there. I had to delete all Chrome browsing data (cache alone wouldn’t do it).
You can accomplish this via the save_post action: add_action( ‘save_post’, ‘wpa78558_save_average_meta’, 100 ); function wpa78558_save_average_meta( $post_id ) { if ( !wp_is_post_revision( $post_id ) ) { $graphics = get_field(‘graphics’, $post_id); $gameplay = get_field(‘game-play’, $post_id); $life = get_field(‘life’, $post_id); $sound = get_field(‘sound’, $post_id); $overall = $graphics + $gameplay + $life + $sound; $overall = $overall / 4; … Read more
Move the query part to a separate function that returns the data you need: function rs_get_scripts_data(){ $array = array(); // query + add stuff to array return $array; } and use it with wp_localize_script like: $array = rs_get_scripts_data(); $myscript_vars = array( ‘array’ => $array ); wp_localize_script( ‘myscript’, ‘myscript’, $myscript_vars );