• I’m having issues with the Reusables plugin v3.0 not working correctly. When I go to edit my reusables, the HTML view gives me only a narrow, non-resizable text box to edit in and Visual appears as though it is missing CSS? There’s no formatting options besides “Font Size” “Format”, no text box frame.

    https://www.ads-software.com/extend/plugins/reusables/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Sean

    (@seannorton)

    I’ve checked this in Internet Explorer 8 and Firefox 8 and, although Firefox gives me a little more functionality (I can adjust the text box size), the WYSIWYG editor is not there and it’s really hindering the functionality of reusables.

    Any help??

    Thread Starter Sean

    (@seannorton)

    Still hoping that the developer for the Reusables Plugin has a moment to review this information to figure out why Reusables isn’t functioning properly with the latest version of WordPress.

    Thread Starter Sean

    (@seannorton)

    Just checking in to see if anyone can help with this.

    Thread Starter Sean

    (@seannorton)

    I have found that one of the reasons for this broken functionality is due to a change in WordPress’ use of TinyMCE.

    I assume at this point the plugin developer has dropped this project, which is unfortunate. I’ve tried tweaking the plugin and have limited success; can anyone assist me in regaining the TinyMCE editor with this plugin?

    Thread Starter Sean

    (@seannorton)

    In the event that someone is experiencing this same problem, I just want you to know that I have patched the problem and all is working as before. I’ll be happy to share this fix with you if youd like.

    Can you post the fix?

    Thread Starter Sean

    (@seannorton)

    You’ll need to edit two php files: page-edit-single.php and page-add.php

    I will post the entire code for you to copy completely for both files. I didn’t have to rewrite the entire thing but it’s easier than explaining which lines to remove/add/edit.

    First, we’ll edit the page-edit-single.php:

    <?php
    
    include_once("./admin-header.php");
    
    if(isset($_POST["_wpnonce"])){
    
    	$id = $_POST["id"];
    	$title = (!empty($_POST["post_title"])) ? $_POST["post_title"] : "(blank)";
    
    	foreach($_POST["user_role"] as $role => $name){
    		$the_roles[$role] = $role;
    	}
    
    	$reusables->update_reus($id, $title, $_POST["content"], $the_roles);
    
    	$message = "Reusable updated. directory."/preview&id=$id',400,400,'preview')\">Preview reusable";
    
    }
    
    if($message){
    	echo "<div class=\"updated below-h2\" id=\"message\"><p>$message</p></div>";
    }
    
    $reus = $reusables->get_reus($_GET["id"]);
    
    ?>
    
    <input type="hidden" name="id" value="<?php echo $_REQUEST["id"];?>" />
    
    <div id="poststuff" class="metabox-holder has-right-sidebar">
    
       <div id="side-info-column" class="inner-sidebar">
          <div id="side-sortables" class="meta-box-sortables ui-sortable">
    
          <div class="postbox " id="categorydiv">
          <div title="Click to toggle" class="handlediv"></div><h3 class="hndle"><span>Publish</span></h3>
          <div class="inside">
             <div class="categorydiv" id="taxonomy-category">
    
                <p><b>Make this reusable visible to:</b></p>
    
                <div class="tabs-panel" id="category-pop">
                   <ul class="categorychecklist form-no-clear" id="categorychecklist-pop">
    
                   <?php $the_roles = array(); $reus_roles = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."reus_roles WHERE reus_id = ".$_GET["id"]); foreach($reus_roles as $role){ $the_roles[] = $role->role; } ?>
    
                   <?php foreach(get_roles() as $role => $name){ ?>
                   <li class="popular-category"><label class="selectit" for="role-<?php echo $role;?>"><input type="checkbox" name="user_role[<?php echo $role;?>]" id="role-<?php echo $role;?>" value="<?php echo $role;?>" <?php echo ((array_search($role,$the_roles) !== false)?"checked":null)?> > <?php echo $name;?></label>
                   <?php } ?>
    
                </div>
    
             </div>
    
          </div>
    
          <div id="major-publishing-actions">
    
             <div id="delete-action">,'<?php echo $reus->post_title;?>')">Delete</div>
    
             <div id="publishing-action">
                <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="Publish" /></div>
    
             <div class="clear"></div>
    
          </div>
    
          </div>
    
          </div>
       </div>
    
       <div id="post-body">
       <div id="post-body-content">
    
       <div id="titlediv">
       	<label class="hide-if-no-js" id="title-prompt-text" for="title" style="visibility:hidden">Enter name here</label>
          <div id="titlewrap">
             <input type="text" autocomplete="off" id="title" value="<?php echo $reus->post_title;?>" tabindex="1" size="30" name="post_title" />
          </div>
       </div>
    
    <div id="postdivrich" class="postarea">
    
    <?php wp_editor($reus->post_content, 'content', array(
    "editor_selector" => "content",
    		"height" => "100%",
    		"mode" => "none",
    		"width" => "100%",
    		"theme" => "advanced",
    		"theme_advanced_toolbar_location" => "top",
    		"theme_advanced_toolbar_align" => "left",
    		"theme_advanced_statusbar_location" => "bottom",
    		"theme_advanced_resizing" => false,
    		"theme_advanced_resize_horizontal" => false,
    		"dialog_type" => "modal",
    		"plugins" => "$plugins" )
    );
    
     ?>
    <table id="post-status-info" cellspacing="0"><tbody><tr>
    	<td class="autosave-info">
    	<span class="autosave-message"> </span>
    	</td>
    </tr></tbody></table>
    
       </div>
       </div>
    
    </div>
    

    Now, we’ll edit the page-add.php file. Again, use the following to replace the contents of the entire file because there are several places I made changes:

    <?php
    
    include_once("./admin-header.php");
    
    if(isset($_POST["_wpnonce"])){
    
    	$title = (!empty($_POST["post_title"])) ? $_POST["post_title"] : "(blank)";
    
    	foreach($_POST["user_role"] as $role => $name){
    		$the_roles[$role] = $role;
    	}
    
    	$reus_id = $reusables->add_reus($title, $_POST["content"], $the_roles);
    
    	$message = "Reusable published. directory."/reus&f=single&id=$reus_id\">Edit reusable";
    
    }
    
    if($message){
    	echo "<div class=\"updated below-h2\" id=\"message\"><p>$message</p></div>";
    }
    
    ?>
    
    <div id="poststuff" class="metabox-holder has-right-sidebar">
    
       <div id="side-info-column" class="inner-sidebar">
          <div id="side-sortables" class="meta-box-sortables ui-sortable">
    
          <div class="postbox " id="categorydiv">
          <div title="Click to toggle" class="handlediv"></div><h3 class="hndle"><span>Publish</span></h3>
          <div class="inside">
             <div class="categorydiv" id="taxonomy-category">
    
                <p><b>Make this reusable visible to:</b></p>
    
                <div class="tabs-panel" id="category-pop">
                   <ul class="categorychecklist form-no-clear" id="categorychecklist-pop">
    
                   <?php foreach(get_roles() as $role => $name){ ?>
                   <li class="popular-category"><label class="selectit" for="role-<?php echo $role;?>"><input type="checkbox" name="user_role[<?php echo $role;?>]" id="role-<?php echo $role;?>" value="<?php echo $role;?>" checked > <?php echo $name;?></label>
                   <?php } ?>
    
                </div>
    
             </div>
    
          </div>
    
          <div id="major-publishing-actions">
    
             <div id="delete-action"></div>
    
             <div id="publishing-action">
                <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="Publish" /></div>
    
             <div class="clear"></div>
    
          </div>
    
          </div>
    
          </div>
       </div>
    
       <div id="post-body">
       <div id="post-body-content">
    
       <div id="titlediv">
       	<label class="hide-if-no-js" id="title-prompt-text" for="title">Enter name here</label>
          <div id="titlewrap">
             <input type="text" autocomplete="off" id="title" value="" tabindex="1" size="30" name="post_title" />
          </div>
       </div>
    
       <div id="postdivrich" class="postarea">
    
    <?php wp_editor($reus->post_content, 'content', array(
    "editor_selector" => "content",
    		"height" => "100%",
    		"mode" => "none",
    		"width" => "100%",
    		"theme" => "advanced",
    		"theme_advanced_toolbar_location" => "top",
    		"theme_advanced_toolbar_align" => "left",
    		"theme_advanced_statusbar_location" => "bottom",
    		"theme_advanced_resizing" => false,
    		"theme_advanced_resize_horizontal" => false,
    		"dialog_type" => "modal",
    		"plugins" => "$plugins" )
    );
    
     ?>
    
    <table id="post-status-info" cellspacing="0"><tbody><tr>
    	<td class="autosave-info">
    	<span class="autosave-message"> </span>
    	</td>
    </tr></tbody></table>
    
    </div>
    
       </div>
       </div>
    
    </div>
    

    Hope this helps. It worked for me.

    Thanks!! Helped a ton :-). Here’s what I did:

    reusables/screens/page-add.php
    reusables/screens/page-edit-single.php

    In both files, remove the entire wp_tiny_mce(…); block.

    In both files, remove all of the Javascript that references tinyMCE:

    var id = 'content';
    tinyMCE.execCommand('mceAddControl', false, id);
    
    $('a.toggleVisual').click(
    	function() {
    		tinyMCE.execCommand('mceAddControl', false, id);
    
    		$(this).addClass("active");
    		$("a.toggleHTML").removeClass("active");
    
    	}
    );
    
    $('a.toggleHTML').click(
    	function() {
    		tinyMCE.execCommand('mceRemoveControl', false, id);
    
    		$(this).addClass("active");
    		$("a.toggleVisual").removeClass("active");
    
    	}
    );

    In page-add.php replace everything within div#postdivrich with:

    <?php the_editor(""); ?>
    <table id="post-status-info" cellspacing="0"><tbody><tr>
    	<td class="autosave-info">
    	<span class="autosave-message">&nbsp;</span>
    	</td>
    </tr></tbody></table>

    In page-edit-single.php replace everything within div#postdivrich with:

    <?php the_editor($reus->post_content); ?>
    <table id="post-status-info" cellspacing="0"><tbody><tr>
    	<td class="autosave-info">
    	<span class="autosave-message">&nbsp;</span>
    	</td>
    </tr></tbody></table>

    Works great with TinyMCE Advanced plugin too.

    Thanks! This worked for me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WordPress Reusables] WYSIWYG Editor not visible in Reusables’ is closed to new replies.