Tagged: enfold
-
AuthorPosts
-
December 21, 2018 at 10:50 am #1048096
Hi,
In the latest version of Enfold + WP, ‘Classic Editor’ is displayed along with drafts in the overview.
Classic Editor is selected in Enfold theme settings.
This makes it hard to see that there are drafts on pages, products, etc.How can you remove the text – it seems that it is related to Enfold.
See screenshot https://imgur.com/a/I4d2TCM
BR, Pete
- This topic was modified 5 years, 11 months ago by 2funky.
December 21, 2018 at 7:40 pm #1048307Hey Peter,
Unfortunately, this is not really the theme territory, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaDecember 21, 2018 at 8:08 pm #1048315Hey Victoria,
I do not think that’s right, it’s because your Enfold built-in ‘Classic Editor’ text is displayed.
Please take a look at it again – For example, under pages, ‘Advanced layout builder’ and products ‘Classic Editor’ text will appear – there is also no reason for it.This is about Enfold theme
BR, Pete
December 21, 2018 at 9:00 pm #1048352Hi Pete,
The Classic editor is the ex “Default WordPress editor”, our editor is the Advanced Layout Builder
https://cl.ly/f8c0c2028ece You can try to hide it with css, but this css is not to be added in the theme options.
Best regards,
VictoriaDecember 22, 2018 at 6:22 pm #1048576Hey,
I’ll try again, again …
If I have activated the ‘Classic Editor’ plugin + select wp settings / writing that I want to use ‘Classic Editor’ and that it should not be possible for the user to choose between blog and Classic editor, the text is still displayed on Enfold.
If I change the theme to ex. Twenty Nineteen, the text ‘Classic Editor’ is not displayed.Therefore, it is not immediately possible to remove the text on Enfold.
Please tell me how to remove the text, as I do not want it to be there, as it makes no sense when the user has no choice.
Hope you understand … I have bought many Enfold templates and this is a simple template fix that should be fixed by Enfold in my opinion.
BR, Pete
- This reply was modified 5 years, 11 months ago by 2funky.
December 27, 2018 at 5:30 am #1049135Hi Pete,
That text is used to make is clear to users which layout builder is used on the page, I’m not sure why you would want to remove that? If you are not planning on using the Gutenberg editor at all then you can disable it using this in your functions.php file:
// disable for posts add_filter('use_block_editor_for_post', '__return_false', 10); // disable for post types add_filter('use_block_editor_for_post_type', '__return_false', 10);
Best regards,
RikardJanuary 2, 2019 at 4:19 pm #1049300Hello again,
Does not remove the text – I have translated ‘Classic Editor’ text it into blank – but it is a half solution.
Please change so that no unnecessary texts is shown like ex. ‘Classic Editor’ + ‘Avanced Laoyout Builder’ under every pages and products ….BR, Pete
January 4, 2019 at 4:41 am #1049780Hi,
Please try adding this at the very end of your themes/child theme’s functions.php file:
// hide post state add_action('admin_head', 'hide_post_state'); function hide_post_state() { echo '<style> .column-title .post-state { display:none; } </style>'; } // End function
There is no easy way to hide the “—” before the text as it is linked with the titles and the title gets affected if we do any changes.
For more information about adding custom script please check this link.
Best regards,
VinayJanuary 4, 2019 at 12:31 pm #1049959Hi Vinay,
Unfortunately, it doesn’t work for me, and if it did, wouldn’t it also remove ‘draft’? – It should not be removed.
It seems that it is a ‘Enfold’ theme problem, i have tried to switch to a standard wp template ‘Twenty Seventeen’, ‘Twenty Nineteen’ and ex. premium ‘Flatsome’ theme – here is text is not shown.
BR, Pete
January 4, 2019 at 2:44 pm #1049994Well i think this will only work if you go over the WP filter display_post_states
this is how f.e. woocommerce does include their “shop” or “cart” status. So it might be possible to get rid of those state info by a new function via add_filteradd_filter( 'display_post_states', 'modify_post_states', 10, 2 ); function modify_post_states( $post_states, $post ) { if ( … ) { … } return $post_states; }
but as I can influence it now in particular, my programming knowledge is not sufficient for that.
you can proove that add_filter method by adding this to your child-theme functions.php
add_filter('display_post_states', '__return_false');
this will completely remove the post state – but then all quick edit options are gone too!January 4, 2019 at 3:13 pm #1050000for example – you can get rid of the ALB info on that list by:
add_filter('display_post_states','remove_ALB_post_state',999,2); function remove_ALB_post_state( $post_states, $post ) { if("!= Avia_Builder()->get_alb_builder_status($post->ID)") { unset($post_states['avia_alb']); } return $post_states; }
January 4, 2019 at 3:30 pm #1050006Hi Guenni007,
Thanks, As I described, I do not want to completely remove ‘post state’ (for example. ‘Draft’ must be visible) – I only want to remove unnecessary text ‘Classic Editor’.
It seems that it is a ‘Enfold’ theme problem – I think they should pass this to development, as I do not experience the problem on other templates..
BR, Pete
January 4, 2019 at 3:38 pm #1050011well – this seems to be a part for Günter – because on class-avia-gutenberg.php there are those additional settings. But the “Classic Editior” state comes not from enfold.
see from line 611 ( public function handler_display_post_states( array $post_states, WP_Post $post ) )
January 4, 2019 at 3:53 pm #1050012maybe try this in your functions.php of your child-them
add_filter('display_post_states','remove_ALB_post_state',999,2); function remove_ALB_post_state( $post_states, $post ) { if("! has_blocks( $post->ID )") { unset($post_states['wp_editor']); } if("!= Avia_Builder()->get_alb_builder_status($post->ID)") { unset($post_states['avia_alb']); } return $post_states; }
and if you want only get rid of classic :
add_filter('display_post_states','remove_CLASSIC_post_state',999,2); function remove_CLASSIC_post_state( $post_states, $post ) { if("! has_blocks( $post->ID )") { unset($post_states['wp_editor']); } return $post_states; }
January 4, 2019 at 3:58 pm #1050014Hi,
Have you seen the ‘Classic Editor’ text next to each product in the woo overview on a any wp standard tempate ??
My customers think it’s confusing – and it makes no sense that the text is shown when you have chosen only to use ‘Classic Editor’
BR, Pete
- This reply was modified 5 years, 10 months ago by 2funky.
January 4, 2019 at 4:01 pm #1050018with the last code i provided the list view on my test is:
January 4, 2019 at 4:03 pm #1050019so now you are talking about woo ( this function is ruled too – on woocommerce itself ! )
this is the look for portfolio entries – you can see that only the classic status is hidden:
January 4, 2019 at 4:12 pm #1050021PS : this code will work if gutenberg is deactivated by (classic plugin) otherwise we had to manage the gutenberg_plugin_active state too.
I do not need the gutenberg – so on my test installation the “classic editor” plugin is running – so the first part of the rules is not needed:
This is the part in the class-avia-gutenberg.php:/** * Add info about ALB to post title * * @since 4.5.1 * @param array $post_states * @param WP_Post $post * @return array */ public function handler_display_post_states( array $post_states, WP_Post $post ) { if( $this->has_wp_block_editor ) { if( $this->need_classic_editor_links() && ! $this->force_classic_editor( $post->post_type ) ) { if( has_blocks( $post->ID ) ) { $post_states['wp_editor'] = $this->gutenberg_plugin_active ? __( 'Gutenberg Editor', 'avia_framework' ) : __( 'Block Editor', 'avia_framework' ); } else { $post_states['wp_editor'] = __( 'Classic Editor', 'avia_framework' ); } } /** * Remove double post status entries - have numeric keys */ if( $this->classic_editor_plugin_active || $this->gutenberg_plugin_active ) { foreach($post_states as $key => $value ) { if( is_numeric( $key ) ) { unset( $post_states[ $key ] ); } } } } else if( $this->gutenberg_plugin_active ) { if( ! has_blocks( $post->ID ) ) { $post_states['wp_editor'] = __( 'Classic Editor', 'avia_framework' ); } } if( '' != Avia_Builder()->get_alb_builder_status( $post->ID ) ) { $post_states['avia_alb'] = __( 'Advanced Layout Builder', 'avia_framework' ); } return $post_states; }
January 6, 2019 at 2:09 am #1050450Hi Guenni007,
Thanks, perfect – it seems to solve the problem.
You can close this, but I would recommend that Enfold remove this text – or make it possible to remove it through the admin.
BR, Pete
January 6, 2019 at 8:45 am #1050531 -
AuthorPosts
- The topic ‘Remove 'Classic Editor' poste state description from overview’ is closed to new replies.