KimTasker
Forum Replies Created
-
Forum: Plugins
In reply to: [Front-End Users] Ajax calls being blocked for anonymous usersI had the same issue, and came up with a fix.
ralphonz’s answer works of course, but deleting this piece of code won’t restrict the access to the admin any more, which is the whole point of the front end users plugin in the first place.Instead, I suggest replacing the code with something like this :
public function restrict_admin_access() { if (is_admin()) { if (strpos($_SERVER['PHP_SELF'], 'wp-admin/admin-ajax.php')===false) { if (!$this->is_logged_in()) { $this->render_page('not-logged-in'); } else if (!$this->has_admin_access()) { $this->render_404(); } } } }
all ajax calls will be allowed now, so the same question arises : is it safe ?
An other solution would be to identify what actions are sent through ajax by other plugins and manually populate the $valid_admin_ajax_actions array in the original code…With the same idea, I’ve had to customize the rewrite_admin_url filter as it exits on not logged users before checking for ajax request…
Better yet, these functions should be overridden in your theme, which requires some knowledge : removing original hooks, adding your own, checking for existence of the feu plugin,… but as the chance the plugin gets updated seems very small (last update in 2011 !), this may not be so important.
Forum: Plugins
In reply to: [Custom Post Type's Archive in WP Nav Menu] Loading gif always visibleI had the same issue, but fixed it. Actually, the plugin meta-box isn’t structured as it should be, some of the code needs to be changed.
If you open cpt-in-navmenu.php in the plugin folder, towards the end of the file you’ll find :echo '<div id="cpt-archive" class="posttypediv">'; echo '<div id="tabs-panel-cpt-archive" class="tabs-panel tabs-panel-active">'; echo '<ul id="ctp-archive-checklist" class="categorychecklist form-no-clear">'; echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $post_types), 0, (object) array( 'walker' => $walker) ); echo '</ul>'; echo '</div><!-- /.tabs-panel -->'; echo '</div>'; echo '<p class="button-controls">'; echo '<span class="add-to-menu">'; echo '<img class="waiting" src="' . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . '" alt="" />'; echo '<input type="submit"' . disabled( $nav_menu_selected_id, 0 ) . ' class="button-secondary submit-add-to-menu" value="' . __('Add to Menu', 'andromedamedia') . '" name="add-ctp-archive-menu-item" id="submit-cpt-archive" />'; echo '</span>'; echo '</p>';
If you replace it with the following (only some minor changes) :
echo '<div id="cpt-archive" class="posttypediv">'; echo '<div id="tabs-panel-cpt-archive" class="tabs-panel tabs-panel-active">'; echo '<ul id="ctp-archive-checklist" class="categorychecklist form-no-clear">'; echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $post_types), 0, (object) array( 'walker' => $walker) ); echo '</ul>'; echo '</div><!-- /.tabs-panel -->'; echo '<p class="button-controls">'; echo '<span class="add-to-menu">'; echo '<input type="submit"' . disabled( $nav_menu_selected_id, 0 ) . ' class="button-secondary submit-add-to-menu right" value="' . __('Add to Menu', 'andromedamedia') . '" name="add-ctp-archive-menu-item" id="submit-cpt-archive" />'; echo '<span class="spinner"></span>'; echo '</span>'; echo '</p>'; echo '</div>';
-
added “right” to the submit button class
deleted the <img /> of the ajax gif
added <span class=”spinner”> after the submit button
the <div id=”cpt-archive”> must include all the box so the closing </div> goes at the endthat’s it
Forum: Plugins
In reply to: [Crayon Syntax Highlighter] Wrong title on copy-paste buttonI have the same issue in current version (v2.2)
it’s easily changed though, you just need to edit crayon_formatter.class.php, and change this line of code (line 303 in the version I have) :
$buttons[‘copy’] = crayon__(‘Expand Code’);switch ‘Expand Code’ to whatever text best suits you (I put ‘Select Code’)