Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    now every user that has “edit_posts” capabilitiy can use WP-Bannerize.

    I know it isn’t the right solution (because everyone knows how to edit urls can bypass it easily), but for the moment I simply hide the menu items… in functions.php:

    //hide wp-bannerize menu items to non administrators
    if ( is_admin() && ! current_user_can( 'administrator' ) ) {
    	add_action( 'admin_menu', 'mwr_remove_wpbannerize' );
    	function mwr_remove_wpbannerize() {
    		remove_menu_page( 'wp-bannerize-mainshow' );
    	}
    }

    and for a minimal control I added:

    //restrict to non administrators
    if ( ! current_user_can( 'administrator' ) ) {
    	return __( 'Error: you have not sufficient privileges!', 'wp-bannerize' );
    }

    at the top of methods insertBanner(), setBannerToTrash(), unsetBannerToTrash(), deleteBanner(), updateBanner() and:

    if ( ! current_user_can( 'administrator' ) ) {
    	echo __( 'Error: you have not sufficient privileges!', 'wp-bannerize' );
    	return;
    }

    at the top of method settings()… all these methods
    of class WPBannerizeAdmin{} in wp-bannerize/Classes/wpBannerizeAdmin.php of WP-Bannerize 3.0.32.

    Hope this can be helpful until this feature will not be well developed directly in the plugin. 🙂

    MoiKano

    Hi Chris,

    I’m glad you’ve solved 🙂

    about the other problem I don’t know: are you sure that you didn’t assign also parent categories to the post?

    to retrieve terms in the “main post type”‘s taxonomy (specified in the WP SEO Internal Links options), WP SEO Breadcrumbs uses wp_get_object_terms() that returns a list of terms in alphabetical order: the first in the list is the “parent” category of the post;

    for example:
    – with “Music” and “Music News”, “Music” is the post’s “parent”;
    – with “Music”, “Music Reviews” and “Singles”, “Music” is the post’s “parent”;
    – with “Music”, “Music Reviews” and “Concerts”, “Concerts” is the post’s “parent”;

    if this is your situation, the solution is very simple: assign posts to the “true” category only;

    I hope this answers your question 🙂

    Hi Chris,

    I suppose you’re using WP SEO 0.2.5.4 (my report was for 0.2.3.2): if so, joostdevalk has updated partially the code… instead of to reverse the order in the get_term_parents() declaration, he reversed the order “directly” in the source, but not for tax/category/tag archives;

    to solve this, you can simply to edit the original “wordpress-seo/frontend/class-breadcrumbs.php” on row #234 so:

    [...]
    if ( is_taxonomy_hierarchical($term->taxonomy) && $term->parent != 0 ) {
    	$parents = $this->get_term_parents($term, $term->taxonomy);
    	// editing start //
    	$parents = array_reverse( $parents );
    	// editing end //
    
    	foreach($parents as $parent) {
    [...]

    I hope you can to solve it 🙂

Viewing 3 replies - 1 through 3 (of 3 total)