It uses several widgets to make up the layout that are added dynamically. The way to edit these widgets come from a file called widgets_rpc.php. I want to add another plugin I have, which allows users to edit text that is wrapped in a shortcode - [ce_sc did="1"][/ce_sc]. When some text is wrapped in this shortcode is clicked, it allows users to edit the text, and also shows "save' "Toggle editor" buttons below the text. When done with the changes, the user clicks "save" to save.
I read about how to include shortcodes in PHP pages outside the wordpress theme, and ended up with this for the widgets_rpc.php file:
<?php require('../../mysite/wp-blog-header.php'); ?> <?php header("Cache-Control: no-cache"); header("Pragma: nocache"); $id=$_REQUEST["id"]; if ($id=="widget1") echo do_shortcode("[ce_sc did='1']<p></p>[/ce_sc]"); if ($id=="widget2") echo do_shortcode('[ce_sc did="2"]<p></p>[/ce_sc]'); if ($id=="widget3") echo do_shortcode ("[ce_sc did='4']<p></p>[/ce_sc]");
So this actually works, almost. It acts as the shortcode regularly does, by allowing user to add text and even pops up a "save" "toggle editor" button on the bottom of the text area, but does not do anything when I click these buttons (as it normally does when done through wordpress). Is there a different method I could try for better results? Or am I missing a crucial step in the shortcode's function in php outside the theme?
PS. This site is on my local computer using server2go as development, otherwise I would have included a link.