yakyak
Forum Replies Created
-
Forum: Plugins
In reply to: [Raptor Editor] Limiting Editable areasI’m trying a similar thing myself.
You can put tags around the content you want editable in a page i.e.
<div class="raptor-editable-area">then if you edit the encloseEditablePosts function in Raptor.php in the plugin folder you can replace those tags with ones for enabling raptor on that area.
public function encloseEditablePosts($content) { global $post; if(current_user_can('edit_post', $post->ID)) { $replace = "<div class='raptor-editable-post' data-post_id='{$post->ID}'>"; $content = str_replace('<div class="raptor-editable-area">', $replace, $content); } return $content; }Then if you change the raptor-in-place-init.js in the javascript folder so that it goes through a loop of those areas rather than applying it to the whole doc… (just needs the top few lines adjusting)
raptor(function($) { var textareas = $('.raptor-editable-post'); if (!textareas.length) return; textareas.each(function() { //if (!$('.raptor-editable-post').length) return; $('.raptor-editable-post').editor({don’t forget to close off the loop with a new
});at the bottom.
I’ve now got editable areas in a post!. A touch hacky but seems to work. Any obvious probs, post them here – I’m still in my infancy with wordpress so I don’t know if I’m doing something terribly dodgy, but I can’t see a prob with it myself.