Viewing 15 replies - 16 through 30 (of 33 total)
  • Hi Scribu

    Thanks so much for doing this. Sadly, however, now when I click on the restricted category, the whirring loading symbol comes up but keeps spinning; no front page edit screen appears.

    I thought this might have been an issue with my local install of WP using MAMP, so I tried it on a live WordPress install (behind passowrd protection). This time I receive these fatal error messages:

    “Fatal error: Call to private method frontEd_field::allow() from context ‘frontEditor’ in /home/lexpress/public_html/wp-content/plugins/front-end-editor/core.php on line 135”

    Do you why this might be happening please?

    Best regards
    Richard

    That’s why it’s in alpha. ??

    The latest version (1.4a4) should work.

    Hi again Scribu. Thanks so much for doing this, and doing it so quickly. It works perfectly now. Brilliant! I’ve just made a Paypal donation to you to say thanks.

    By the way, and just out of interest, would it be possible to create similar code which works for subpages of a given parent page AND for that code to work at the same time as the category code? I ask, really out of interest, because previously I tried the category and page code together and it made my site go blank (upon which I rapidly removed it of course).

    In any event, thanks again for the new version. Great stuff.

    Best regards
    Richard

    I thought someone might need that. Here’s the other part of the code:

    add_filter('front_ed_allow_post', 'restrict_to_parent_page', 10, 2);
    function restrict_to_parent_page($allow, $post_id) {
    	// Only apply this check to pages
    	if ( 'page' != get_post_field('post_type', $post_id) )
    		return $allow;
    
    	$ancestors = get_post_ancestors($post_id);
    	$parent_page = 123;
    
    	return $allow && in_array($parent_page, $ancestors);
    }

    Hi Scribu,

    Firstly, many thanks for taking the time to create and improve on your front-end editor plugin. I’m integrating it into a website, and I’ve run across a small stumbling block…

    The example code you gave for restricting the front-end editor to a single category works fantastically, I added it, changed the category fields, and it worked. However, one of the side effects of this filter is that it seems to remove the original text from the input field of the editor when editing. Prior to adding the filter to the functions.php, the input field in the editor was populated with the original content, and upon removing the filter, it is re-instated. I don’t suppose you know what might be causing this minor bug, and how to rectify it?

    I’ve checked this out in Firefox 3.5.5 & Safari 4.0.3 in Mac OS 10.6.1 and I don’t have the rich text editor enabled.

    Kind Regards,

    Xander

    First of all, I hope you’re using this code, not the old version:

    add_filter('front_ed_allow_post', 'restrict_to_category', 10, 2);
    function restrict_to_category($allow, $post_id) {
    	return $allow && in_category('Your Category', $post_id);
    }

    Secondly, what version of WP are you using?

    Install Firebug and follow the AJAX requests in the console.

    I’m using the up-to-date version of the code, with WordPress 2.8.6. I’ve disabled all other plugins to see if there is any conflict, but that’s thrown back a dud. I’ve followed the AJAX requests in the Firebug console, but it doesn’t throw any errors back at me apart from “compactMenu not defined” (onload(load) in the growfield.js file).

    When I double-click the text field to edit, it doesn’t seem to populate the field with any text, and if I click “Save”, it doesn’t seem to save the edition, and returns a blank post. If I remove the code to enable the plugin to edit across all posts, the full functionality is restored.

    I hope it’s not something blindingly obvious I’m missing…

    xanderashwell, I can’t reproduce your problem. Therefore, I can’t fix it. Sorry.

    Hi Scribu,

    My apologies for being an eternal idiot. I tried to recreate this issue in a different theme, and got the same error. I realised the full extent of my idiocy when I understood that the `add_filter(‘front_ed_allow_post’, ‘restrict_to_category’, 10, 2);
    ` snippet of code didn’t refer to the category id numbers, and was to be left alone. I had changed the “10,2” to correspond to my category id’s.

    Fool.

    My apologies again for wasting your time, and congratulations on your ace ace plugin.

    Xander

    Glad to hear you figured it out. Should have asked you to post the exact code you were using at the beginning.

    Hi Scribu

    Thanks again for this super plugin.

    Could you let me know please whether it’s possible to use the code below to make front-page editing possible for a number of selected categories, rather than only one category?

    add_filter('front_ed_allow_post', 'restrict_to_category', 10, 2);
    function restrict_to_category($allow, $post_id) {
    	return $allow && in_category('Your Category', $post_id);
    }

    Many thanks
    Richard

    add_filter('front_ed_allow_post', 'restrict_to_category', 10, 2);
    function restrict_to_category($allow, $post_id) {
    	$allowed_cats = array('First Category', 'Another one', 'Etc...');
    	return $allow && in_category($allowed_cats, $post_id);
    }

    Brilliant. Thanks Scribu. Much appreciated.

    Hi again Scribu

    Can I just check please if the code above, which allows one to limit the FEE to selected categories, is still working in the latest release of FEE? I ask because I’m using it but without success.

    The code I’m using is this:

    <?php
    
    add_filter('front_ed_allow_post', 'restrict_to_category', 10, 2);
    function restrict_to_category($allow, $post_id) {
    	$allowed_cats = array('Templates', 'Website terms of use');
    	return $allow && in_category($allowed_cats, $post_id);
    }
    
    ?>

    The theme I’m using is quite complex and has a functions.php file which pulls in a number of functions files from a functions library. The calling code I’m using in the main functions.php file, which follows the same model as for other functions it’s pulling in, is as follows:

    // Load Front End Editor functions
    require_once(WEBTREATS_FUNCTIONS . '/front-page-editor-functions.php');

    Do you have any idea please why the code you’ve provided might not be working?

    Any help much appreciated.

    Richard

    The hook names have been changed.

    Replace 'front_ed_allow_post' with 'front_end_editor_allow_post'.

    See https://scribu.net/wordpress/front-end-editor/fee-1-7.html

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘[Plugin: Front-end Editor] Only show Front End editor for posts belonging to a particular category?’ is closed to new replies.