Show WordPress Editor in Plugin Settings - wordpress

I want to show the user a WordPress Editor to be able to use media and text and etc like post editor and save it in the options table. Of course, I can't use textarea or input but how can I do it?

Needed to just use this simple code:
<?php wp_editor( $content , 'editor-id' ); ?>
Thanks for your votes by the way!

Related

Can we replicate ACF functionality in our theme?

Hi i want to add advance custom fields in my wordpress theme. I don't need editor functionality but to provide the users the facility to enter the values to view in the frontend.
basically i want to add the custom fields in my theme just like ACF but i don't want to use the plugin. Is there anything anyone can help me out with this please do.
I'm using ACF plugin right now to add custom fields in my theme.
For example I'm getting the designation from user in the admin panel and our team members custom post type. and showing it on the home page by using this code.
<p><span class="fa fa-user-circle"></span> Designation</strong>:<?php echo the_field( 'designation' ); ?> </p>
I don't want to use ACF plugin to perform this task. I know about the wordpress custom field. The problem with wordpress custom field is I've to select the key every time when I create a post. Here's a sample of what I'm trying to do. I want to add the this in my add new post.
Right now I've to select the key value whenever a new post is created. I want something similar to the image attached in my add new post. Thanks.
You can use native WordPress function(s) to do the same thing. Of course, you lose the extensive ACF features and slick ACF admin panels.
Instead of using ACF's get_field(), you can use get_post_meta(get_the_ID(), 'field', true);
List all items in the meta field 'appartments' like so:
$meta_name = 'appartments';
$fields = get_post_meta( $post->ID, $meta_name, true );
foreach ( $fields as $fieldValue )
{
echo $fieldValue . ' ';
}

Display language switcher button shortcode of WPGlobus plugin - Wordpress

I am using WPGlobus plugin to make website multi-language. A widget is displaying in widget area but I want to add language switcher button manually.
I search its short code to display language switcher flags. But not found any any shortcode.
Any best way to display buttons manually by shortcode.
Use this code on your wordpress theme . I hope will help you!
<?php the_widget( 'WPGlobusWidget' ); ?>

Add php user input controller to wordpress customizer

Trying to customize the Wordpress Theme Customizer to allow users to input either a shortcode or a custom php string. Currently, I have many user input fields for text input, but I can't figure out how to sanitize the text correctly to allow for php.
Any suggestions on where to start?
Thank you user5552351 for your response.
After looking at the codex you referenced in your comment, I realized I was way over thinking the solution.
Turns out all I needed was to give the user a text input that allows for basic brackets [] and apostrophes '' while inside a do_shortcode function.
<?php echo do_shortcode(get_theme_mod( 'THEME_MOD_ID', 'THEME_MOD_DEFAULT_VALUE' ));?>
where THEME_MOD_ID is the identifier for the Theme Customizer Control. So Basically there's a section in my theme customizer called 'Contact' that holds a text input setting/control called 'custom_contact_form', where a user can input a shortcode (ex: [simple_contact_form] ) and it will replace everything between do_shortcode( + ). So my code might look something like this:
<?php echo do_shortcode(get_theme_mod( 'custom_contact_form', '' ));?>

WordPress Gallery Displays Code

I inserted a gallery into a post of mine on WordPress but when I view the gallery on the website it comes up like this:
[gallery size="medium" ids="110,109,108"]
I've made the post go to a certain page of the website in the code:
<?php
$post_id = 5;
$queried_post = get_post($post_id);
echo $queried_post->post_content;
?>
could this affect it?Why does this happen? How can I fix this?
(I've also discovered for any shortcodes it does the same thing)
Thanks
For that you can use the Wordpress Loop as they are in default or another way is you have to use like add_filter('the_content', $queried_post->post_content);. Thanks!

wordpress shortcodes show up in preview posts

http://www.mytwins.gr/site/
In the third blog post you will see that a shortcode shows up [frame align="none"]Της Εύης Σταθάτου[/frame] which is ugly. Only if you click it, it works fine.
Why is that?, How can you hide the code from the previews posts thingy? Thanks in advance.
P.S I tried to hide the shortcode from the visual mode and enter it in the text mode, but still the same.
As #Ravi suggests, make sure that your plugins are enabled. However, it looks like your shortcodes are appearing within your excerpts (assuming you're using the_excerpt() for the snippets appearing on your homepage?)
I would suggest a handy snippet of RegEx:
$myExcerpt = get_the_excerpt();
$myExcerpt = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $myExcerpt);
echo $myExcerpt;
That should stop the raw shortcodes from appearing.

Resources