TinyMCE Multiple Custom Classes Selections

Ok, I found the correct format for this TinyMCE issue which also retain some of the original Style Format selections. Enjoy! function my_wpeditor_buttons( $buttons, $editor_id ) { if ( ‘content’ != $editor_id ) { return $buttons; } array_unshift( $buttons, ‘styleselect’ ); return $buttons; } add_filter( ‘mce_buttons_2’, ‘my_wpeditor_buttons’, 10, 2 ); function my_wpeditor_formats_options( $settings ) { … Read more

Could you please correct the code is_admin()

What is a moderator? A custom user role? If yes, then: add_action( ‘init’, ‘blockusers_init’ ); function blockusers_init() { if ( is_admin() && (!current_user_can( ‘administrator’ ) || !current_user_can( ‘moderator’ ) ) && ! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) { wp_redirect( ‘http://madeeasy-online.com/zhile-2/dobavit-obyavlenie/’, 302); exit; } }

My query keeps looping infinitely ! how to stop it?

Like Tom commented, your code is hard to read. You can look at the code snippet below as a suggestion based on what your code. function get_posts_by_admin_role( ) { if ( is_admin() && !is_front_page() && !is_singular() && !is_archive() ) { $args = array( ‘role’ => ‘administrator’, ‘orderby’ => ‘post_count’, ‘order’ => ‘ASC’, ‘count_total’ => false … Read more

uninstall a theme programmaticlly

The limit of the child theme is not a border from WordPress, maybe your webspace. If you remove the directory of a child theme, include all files, if is deleted. For the delete of the folder use rmdir(). The method rmdir() is part of the classes that extend WP_Filesystem_Base, like WP_Filesystem_Direct and accordingly the rmdir() … Read more

Restoring pages in wordpress

Probably the best solution is to restore your WP database, if you have backup. If not, ask your hosting provider to do that, if you are on shared on VPS hosting, they should make full backup of your account and database every 1-2 days (even without your knowing). Because you exceeded disk quota, maybe something … Read more

Get title from IDs in a string

get_the_title takes an int, not an array of ints, and therefore returns a string, not an array of strings. So just break that bit out into a loop: $titles=””; foreach ($act_name as $act_name_item) { $titles .= ($titles ? ‘,’ : ”) . get_the_title ($act_name_item); }