Oleg Butuzov
  • Member for 9 years, 10 months
  • Last seen more than a month ago
Is it possible to remove WYSIWYG for a certain Custom Post Type?
Accepted answer
26 votes

add_action('init', 'init_remove_support',100); function init_remove_support(){ $post_type = 'your post type'; remove_post_type_support( $post_type, 'editor'); } place it to your themes ...

View answer
Replace Taxomony Description Field with Visual/WYSIWYG Editor
Accepted answer
19 votes

You can use a {$taxonomy}_edit_form_fields action hook to add html to the term edit table. In that HTML you can remove description textarea and add tinymce editor add_action("{$taxonomy}...

View answer
Do WordPress cron jobs slow down page loading?
Accepted answer
11 votes

Short answer - Nope. Any page request initializes the scheduled queue. It's just an initialize request. Wp-cron request is a standalone request. so requesting URL /somepage you just initialize ...

View answer
How to get author's name by author's id
10 votes

echo get_the_author_meta('display_name', $recent["post_author"]); // code from deprecated.php function @get_author_name More examples of get_the_author_meta($meta_key, $author_id) you can find at ...

View answer
Hide View and preview from custom post types
Accepted answer
8 votes

You need to set argument public to false at register_post_type() function. Whether a post type is intended to be used publicly either via the admin interface or by front-end users. Default: ...

View answer
Minimum Template Files for Theme Development
7 votes

Two - styles.css and index.php. If you're gonna add additional functionality (some filters or actions) add to list functions.php. If you're gonna add additional templates + number of templates add ...

View answer
Hook into $wpdb
Accepted answer
7 votes

query - you will get sql as argument of the callback. add_filter('query', 'some_callback_that_change_query'); function some_callback_that_change_query($sql){ remove_filter('query', '...

View answer
Get all terms inside a specific taxonomy in a multisite
Accepted answer
6 votes

No way to do that in a "word press" way... function multisite_profession_select(){ switch_to_blog(1); $taxonomies = array('rsitecat'); $check_later = array(); global $wp_taxonomies; ...

View answer
Manually trigger a wp_schedule_event item?
Accepted answer
6 votes

Why not just to do_action($hook) of your cronned event?

View answer
Strategy for handling hierarchical pages with empty parent content
5 votes

I am using two strategies here... 1) is simple redirection to first child (using menu order) page-redirect.php <?php /* * Template Name: Redirector * Description: Empty Holder (redirect page) ...

View answer
Set default avatar network-wide
5 votes

Must Use Plugins will anable functionality global. And actualy functionality is pretty simple... only prefiltring default_avatar value. Use this code as plugin which you can install to anable default ...

View answer
What are the advantages of using wp_enqueue_script()
4 votes

How about API? Let's Check this example. $id = 'plugin-id'; $syffix = ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min' ); $script_url = plugins_url( 'js/' .$id . $suffix . '.js',...

View answer
External WordPress API
4 votes

WordPpress platform provides XML-RPC support which you can use to maintain your WP site. You also enable to extend functionality of build in xml-rpc methods to use it for your needs.

View answer
How do I change the language of only the login page?
4 votes

You can repalce define( 'WPLANG', 'de_DE'); in your wp-config.php by this code structuer. if (basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)) == 'wp-login.php'){ define( 'WPLANG', '...

View answer
Disallow authors to edit/delete their own or other published posts
Accepted answer
4 votes

Downgrade tham to Contributors user role.

View answer
Which is better and faster ? Wordpress Queries or SQL Query
Accepted answer
3 votes

Queries ofcourse. It's faster... But in this case just please delete you wp site and start with something faster... here is my superfast framework for you... <?php /*Your bunny wrote */ I did ...

View answer
Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?
3 votes

I belive you can use a load_textdomain_mofile filter... add_filter('load_textdomain_mofile', 'custom_load_textdomain_mofile', 10, 2); function custom_load_textdomain_mofile( $mofile, $domain){ if ...

View answer
Custom wp_welcome_panel for every role or custom dashboard
3 votes

There are two ways to do that. You can (a) Edit capability from edit_theme_options to read in wp source code. or (c) Change (override) capabilty on a fly for wp-admin/index.php for any usertype... ...

View answer
Custom Meta Field - Youtube embed
Accepted answer
3 votes

Maybe it's better to use a textarea instead of an input field. And of course $allowed doesn't contain the iframe tag. And for sure you will be not able delete the saved video_1... Too many things not ...

View answer
Allow dot in wordpress permalinks (only for categories)
Accepted answer
3 votes

Well in case you need to change look of generated permalinks take a look to sanitize_title_with_dashes function which is one of filters of the sanitize_title hook filters. If that only one request ...

View answer
queries inside of a class
Accepted answer
3 votes

class MyClass{ function __construct(){ global $wpdb; $this->db = $wpdb; } function query(){ return $this->db->query( $this->db->prepare("...

View answer
Hide submenu wordpress?
Accepted answer
3 votes

If you deal with wp menus you shoudl use admin_menu filter. add_filter('admin_menu', 'admin_menu_filter',500); function admin_menu_filter(){ remove_submenu_page( 'themes.php', 'widgets.php' );//...

View answer
Filter any HTTP request URI?
3 votes

add_filter('http_request_args', 'http_request_args_custom', 10,2); function http_request_args_custom($request,$url){ if (strpos($url, 'wordpress.org') !== false){ ...

View answer
Combining wp_insert_post() and update_post_meta()
Accepted answer
2 votes

2020 Update: In case you landed here looking for a refresher on how to update the post's meta, as I did, see the following edit: The post array argument in wp_insert_post() takes an inner array called ...

View answer
.htaccess rewriterule being ignored - tyring to remove dates from WP posts
2 votes

You can actually change them in Settings -> Permalinks and it will change the link that generated for the post. And if you still be unhappy with result you can remove WordPress rewrite rules for dates ...

View answer
Custom Template 404 for specific custom post type
Accepted answer
2 votes

This is going to track only post_type query var, but you also can add checks for query_vars of all your post_types or only ones you would like to get a custom 404 page for. add_filter( '...

View answer
Add menu and submenu in admin with a URL instead of slug?
2 votes

I don't recommend you do that. Let's assume your prefix for admin.php is _trigger_me_ Submenu <?php function _clean_url_to_repalce_admin_menu($url, $original_url, $_context){ if ($url == '...

View answer
add_rewrite_rules prefix everything
2 votes

Have you ever consider to use rewrire_rules_array filter to alter $rewrite_rules? /** * Example of Changing All Rewrite Rules * * @param array $rewrite_rules The compiled array of rewrite rules. ...

View answer
Why is Wordpress custom post type not showing in admin panel?
2 votes

Please check what the value of the show_in_menu and show_ui arguments for register_post_type your post types before you register tham.

View answer
Hook to edit an column on comments screen?
Accepted answer
2 votes

There is no filter for this column. So answer is 'No'. WP_List_Table search for method column_{something} inside class of Lister. Comments List class has column_author. So kill this column, and ...

View answer
1
2 3 4 5