Tag Info

New answers tagged

1

Well... WordPress uses the wpeditimage tinymce plugin to perform the tasks for the "Add Media" editor button. When you click the pencil icon to edit the image... the wpeditimage plugin will read the image code, and determine if there is a value of _blank for the target attribute. If the value is _blank; the plugin will check the box when the modal window ...


0

It's easier to remove specific shortcodes than it is to remove_all_shortcodes() and enable specific shortcodes. To disable specific shortcodes from display everywhere, you would use the following: <?php add_filter( 'the_content', 'oxo_remove_shortcodes', 0 ); function oxo_remove_shortcodes( $content ) { /* Add the shortcodes that you would like ...


0

Adding filter: add_filter( 'upload_dir', 'change_upload_dir', 10, 1 ); Function content: function change_upload_dir($param) { // Check for REFER $actual_page = $_SERVER['HTTP_REFERER']; parse_str( parse_url($actual_page, PHP_URL_QUERY), $query_array ); if ( strpos($actual_page, 'plugin_name.php') ) { ...


0

add_action('init', 'init_remove_support',100); function init_remove_support() { $post_type = 'your post type'; remove_post_type_support( $post_type, 'editor'); } Add this to your themes functions.php and it should take care of it. cheers :)


2

You can update the override the post labels: function wpse163462_rename_menu_post_to_article() { global $menu; global $submenu; $menu[5][0] = 'Articles'; $submenu['edit.php'][5][0] = 'Articles'; $submenu['edit.php'][10][0] = 'Add Articles'; echo ''; } function wpse163462_rename_post_to_article() { global $wp_post_types; ...


0

Yes you can do that. Use function add_menu_page http://codex.wordpress.org/Function_Reference/add_menu_page to add parent "All post types", then use add_submenu_page http://codex.wordpress.org/Function_Reference/add_submenu_page to add pages to parent page: add_action( 'admin_menu', 'my_custom_menu_page' ); function my_custom_menu_page() { ...


2

Per comments, an alternative is to use the built-in Firefox debugger instead (Inspect Element (Q)) - it's very good (now) and is (almost completely) unaffected by the WP heartbeat.


1

You can generate page views count without any plugins. What you need to do is create a post meta key for each post (of course automatically) and increase the counter of this post meta key on each post/page load or visit. So here is the function to create a post meta key post_views_count for each post and calling this function on each page/post load will ...


0

There are many plugins out there showing the site's statistics along with the popular posts/pages with their reading count. Jetpack by WordPress.com - has a nice site statistics module And there are others too... Google search result WordPress plugin repo search result Most of them even provide a short stat view dashboard widget from where you can ...


0

Every post / page / post type is wrapped around a universal form with the ID of #post. So if you want to validate a page before submitting it you just need to say something like: jQuery(document).ready(function($){ $('#post').submit(function(){ // Validate Stuff return false; }); }); Then you'll want to actually enqueue your ...


0

This will properly override the user settings to keep the menu collapsed for all users: /** * Reset user setting to always collapse the admin menu. * * @see set_user_setting() */ function wpdocs_always_collapse_menu() { if ( 'f' != get_user_setting( 'mfold' ) ) { set_user_setting( 'mfold', 'f' ); } } add_action( 'admin_head', ...


0

You can try something like this. function make_menu_unfolded() { print '<script>jQuery(document).ready(function(){jQuery("body").addClass("folded")})</script>'; } add_filter( 'admin_head', 'make_menu_unfolded' ); This is make left menu fold always.


0

This post suggests that it may be an issue with the database itself, and you should run the 'repair database' feature via phpMyAdmin.


0

there isn't an "space" in the Shortcode-Name. What you have, is an shortcode called "customcont", that is providing an Parameter called "form". So this is, how it should work: function example_shortcode( $atts = array(), $content = '' ) { extract( shortcode_atts( array ( 'form' => 0, ), ...


0

Your page reference is held in $_REQUEST['page'] so rather than hard coding your plugin page, use that.


1

I just found a way around the problem, but it's a kludge, so I won't accept my own answer unless nobody has a "real" solution. If I set a break-point in my JavaScript and do my investigation while it's paused, that prevents all future script from running, including whatever script is refreshing the page.



Top 50 recent answers are included