mac2net
Forum Replies Created
-
Forum: Plugins
In reply to: [CMB2] SVG filtered out of wysiwygHi Michael
The problem is SVGs have a whole new set of nomenclature.
Instead it looks like the following code successfully modified the wysiwyg field.
I could add a conditional to only execute in a narrow circumstance.Cheers
MikePS I cobbled this together from the Attached Posts Field sample.
Class mywysisyg_CMB2_Sanitize { public function __construct() { add_action( 'cmb2_sanitize_wysiwyg', array( $this, 'sanitize' ), 10, 2 ); } public function sanitize( $sanitized_val, $val ) { if ( ! empty( $val ) ) { return htmlspecialchars_decode( stripslashes( $val ) ); } return $sanitized_val; } } $cmb2_wysiwyg = new mywysisyg_CMB2_Sanitize();Forum: Plugins
In reply to: [CMB2] SVG filtered out of wysiwygI did some investigation.
I am using the Text Control plugin which protects content, excerpts and comments (if I want) from the WP filter – wp_kses_post.I think what I need to do is replace the sanitize code with that of the code text areas:
return htmlspecialchars_decode( stripslashes( $this->value ) );Is there any way to do this in an outside function in my custom metabox plugin (in which CMB2 is enclosed) so I will be able to control where this happens?
Thanks
Mike/** * Sanitize textareas and wysiwyg fields * @since 1.0.1 * @return string Sanitized data */ public function textarea() { return is_array( $this->value ) ? array_map( 'wp_kses_post', $this->value ) : wp_kses_post( $this->value ); } /** * Sanitize code textareas * @since 1.0.2 * @return string Sanitized data */ public function textarea_code( $repeat = false ) { if ( $repeat_value = $this->_check_repeat( __FUNCTION__, $repeat ) ) { return $repeat_value; } return htmlspecialchars_decode( stripslashes( $this->value ) ); }Forum: Plugins
In reply to: [CMB2] SVG filtered out of wysiwygUploading SVG is easy to configure.
The problem is the wysiwyg field is filtering out the sag tag and SVG-CSS styles like fill.
But in the normal content this doesn’t happen.Forum: Plugins
In reply to: [CMB2] SVG filtered out of wysiwygSaving the post.
Thanks. MikeForum: Plugins
In reply to: [Prism Syntax Highlighter for WordPress] Suggestion for uploads directoryI didn’t finish this, but the key is to get the data out of the settings
I added this
<p>Jonradio settings:<br /> <?php print_r(get_option( 'jr_mt_settings' )) ?> </p>to the
admin-sections.phpfile of the plugin under
function jr_mt_aliases_expl()Line 479.
This will show you the array in which to search the URL you want to query to match it with the permalink of the post query object to determine if you want to display the metabox.
Forum: Plugins
In reply to: [Multiple Themes] Display metabox on post.php if it matches URL/theme settingI think I figured it out.๐
Forum: Themes and Templates
In reply to: [Writr] visual load problemThanks.
No problem with the parent – checked that already.I think my child CSS was based on 1.0.8 with header, menu and sidebar sitting on top of one another, but now the header and menu are nested inside the sidebar with the funny javascript so I have to re-examine the width, padding and margin.
I got the wide expansion to stop but now the header menu start at left:0 and then shift out. I will get it.
Thanks again.Forum: Plugins
In reply to: [Multiple Themes] Display metabox on post.php if it matches URL/theme settingSorry, maybe I wasn’t clear:
- CMB2 – no problem
- CPTs – no problem
Now I just need to figure out to query the plugin for a match in the settings in order to display the metabox. Do you know this?
Thanks
MikeForum: Plugins
In reply to: [Multiple Themes] Display metabox on post.php if it matches URL/theme settingSorry, why did you resolve this?
Forum: Plugins
In reply to: [Multiple Themes] Display metabox on post.php if it matches URL/theme settingForum: Plugins
In reply to: [CMB2] Migration, general questionHi
Congrats and thanks for the update.
As I don’t think I am implementing any edgy/outlier cases, should I just follow the Notable Changes guidelines for upgrading?I am also going to retire another plugin but I am confident this won’t be problematic.
Thanks
MikeForum: Plugins
In reply to: [Customize Posts] Can't get this workingHi Weston
I just checked another site and editing/saving meta data is working.
The biggest difference between sites is the one that’s not working is part of a multisite.
I will have to do some playing to see if in fact it’s a conflict with another plugin.Cheers
MikeForum: Plugins
In reply to: [Customize Posts] Can't get this workingHi Weston
Now it seems to be working including my small patch to add another post type.
Some feedback:
- There is no linkage between the Previewed post and the Customizer panel. So when previewing a post, the Customizer fields don’t change to reflect that post and selecting a post in the Customizer doesn’t change the Preview. I can sync them manually.
- The plugin uses the traditional Custom Fields UI and shows a fieldโs ID, instead of Name (which I guess is optional in WordPress). But since the Customizer is for users, it might be better to use Name if there is one and to use the Metabox UI rather than the Custom Fields UI.
- Iโm using Posts2Posts which are not displaying at all. I see this data is stored in a separate table with a different structure. I suggest (easier said than done) some kind of API to add 3rd party metaboxes to deal with this and other (many Iโm sure) cases like this.
- Are edits of fields in the Customizer supposed to work? That doesn’t seem to be happening.
I will give you more feedback as other things come to my attention.
Cheers
MikeForum: Plugins
In reply to: [Customize Posts] Can't get this workingThanks.
I’m in the middle of troubleshooting a bunch of things with another eye on the news (I’m in Europe).In my developer 5doc content site I use custom post types. The plugin seems not be conflicting but not showing any posts.
In class-wp-cusomize-posts.php line 95 I modified it to:
'type' => array('post','content'),to add the contentcustom post type.
Do I need to make any other mods?Before giving you the list of other plugins that conflict I will test the new version.
Cheers
MikeForum: Plugins
In reply to: [Customize Posts] Can't get this workingHi Weston
Thanks. i found the conflict – JetPack.
So while I apologise for wasting a bit of your time, hopefully since it is very widely used, this info is helpful.I will play a bit with the plugin and make another post here ASAP.
Cheers
Mike