Creating table layout in WYSIWYG editor

Why you are not using table? Spaces are ridiculus. On WYSIWYG editor select table with 2 columns and 3 rows, align items in left column to left, and in right to center and everything should work fine. EDIT. Ok, I see where is the problem. TinyMCE (WYSIWYG editor) has table option, but by default it … Read more

How to edit title on Edit post pages?

Add this code instead on your functions.php, this will change the post and product title to the post or product that is being edit: add_filter(‘admin_title’, ‘my_admin_title’, 10, 2); function my_admin_title($admin_title, $title) { global $post, $action; if ( isset($post->post_title) and $action == ‘edit’ ){ return ‘Edit < ‘.$post->post_title.’ – ‘.get_bloginfo(‘name’); } else { return $title .’ … Read more

editor-style.css Functionality

The correct way to enqueue an editor stylesheet is as follows: add_action( ‘after_setup_theme’, ‘generate_child_setup’ ); function generate_child_setup() { add_editor_style( ‘path/to/editor-style.css’ ); } I pulled that snippet from here: https://generatepress.com/forums/topic/how-to-call-editor-style-css-from-child-theme/#post-149083 I guess the intuitive approach for most would be to enqueue it in the admin but that wouldn’t apply it correctly. I believe add_editor_style() ensures it’s … Read more

Are there individual memory allocations for different user roles in WordPress?

Because of this line in wp-admin/admin.php: if ( current_user_can( ‘manage_options’ ) ) { wp_raise_memory_limit( ‘admin’ ); } In other words, WordPress raises the memory limit to WP_MAX_MEMORY_LIMIT within the admin, but only for users with the manage_options capability i.e. administrators. Your best bet is to raise the default memory limit in your wp-config.php: define( ‘WP_MEMORY_LIMIT’, … Read more

Make substitute in all WordPress posts

There are many ways to do this here a couple: 1) You can use something like: Better search and replace plugin here: https://wordpress.org/plugins/better-search-replace/ or SAFE SEARCH AND REPLACE ON DATABASE WITH SERIALIZED DATA script here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Both of these with serialize the data, which is important for many themes and plugins. There is a good … Read more

Is it possible to “comment out” text in a post?

There may be plugins that supply some kind of commenting functionality, similar to how Google Docs allows you to annotate parts of a document. Within WordPress directly, you could use the “Text Editor” view and HTML comments. The downside here is that the HTML comments will be visible if someone goes to the page and … Read more

Limiting allowed html elements/strip harmful scripts from editor

Adjust HTML-Filter: <?php function fb_change_mce_options($initArray) { // Comma separated string od extendes tags // Command separated string of extended elements $ext=”pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]”; if ( isset( $initArray[‘extended_valid_elements’] ) ) { $initArray[‘extended_valid_elements’] .= ‘,’ . $ext; } else { $initArray[‘extended_valid_elements’] = $ext; } // maybe; set tiny paramter verify_html //$initArray[‘verify_html’] = false; return $initArray; } add_filter(‘tiny_mce_before_init’, ‘fb_change_mce_options’); ?> … Read more