Forcing max-width for image captions
why not set white-space : normal ? https://developer.mozilla.org/en-US/docs/Web/CSS/white-space without seeing the rest of your css, its hard to determine why the text isn’t wrapping naturally
why not set white-space : normal ? https://developer.mozilla.org/en-US/docs/Web/CSS/white-space without seeing the rest of your css, its hard to determine why the text isn’t wrapping naturally
You should always sanitize all inputs regardless of who or where they are coming from. Not only is it good practice (which helps ensure that you don’t accidentally get comfortable skipping it and miss it elsewhere), but it ensures that that particular feature is secure in the future. For example, you may wish to expand … Read more
So I found my answer in the codex. content_save_pre() is my friend. Here is the usage: function my_sanitize_content( $content ) { return do_shortcode($content); } add_filter( ‘content_save_pre’ , ‘my_sanitize_content’ , 10, 1); Haven’t tried it yet, it should work I suppose.
Maybe I misunderstand what you are doing, and I apologize if that is the case, but… It looks like you are returning content if the post DOES NOT already have one, which looks backward to me based on my understanding of your problem. It looks like you are trying to execute a broken (incomplete) shortcode. … Read more
How to wp_redirect on ‘init’ hook on condition of current post id?
I don’t know why the code is not working. But this is how i did this may be helpful for some noob like me <?php $name = get_the_content(); preg_match(‘/\]*)\”]/’, $name, $match); $w3_ids = explode( “,”, $match[1] ); $gallery_count=1; foreach( $w3_ids AS $w3_id ): $src = wp_get_attachment_image_src($w3_id,’full’); ?> <div class=”item <?php if($gallery_count==1)echo “active”; ?>”> <img src=”https://wordpress.stackexchange.com/questions/193166/<?php … Read more
How to prevent shortcode preview from breaking in tinymce editor?
You can check for user capability (aka non-admins) and remove shortcode you don’t want to be formatted: …in functions.php $cuser = wp_get_current_user(); if (!isset($cuser->allcaps[‘administrator’]) || !$cuser->allcaps[‘administrator’]) { remove_shortcode(‘your_shortcode_tag_name’); } You can also remove all shortcodes using remove_all_shortcodes function.
The WordPress application (ie. from WordPress.org) does offer some default shortcodes that you can reference. [contact] is not one of them. You seem to be referring to the Shortcodes offered by WordPress.com however these shortcodes are peculiar to sites hosted on WordPress.com – they will not work in your WordPress application. To call other shortcodes … Read more
Print shortcode in defined area