WordPress.org

Ready to get started?Download WordPress

Forums

AtContent — Grow Audience & Blog Traffic
[resolved] Major AtContent Conflict with AgentPress Listings Plugin (4 posts)

  1. Forson
    Member
    Posted 9 months ago #

    AtContent plugin has a conflict with http://wordpress.org/plugins/agentpress-listings/

    When AtContent is installed, it removes the tab of the listings plugin from the admin console. I fixed by making the changes below but with the latest version of AtContent, my below fix brought back the listings tab but the AtContent tabs were missing.

    atcontent/atcontent.php

    add_menu_page( ‘CopyLocator’, ‘CopyLocator’, ‘publish_posts’, ‘atcontent/copylocator.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ), 6 );
    
    add_menu_page( ‘Guest Posts’, ‘Guest Posts’, ‘publish_posts’, ‘atcontent/guestpost.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ), 6 );
    
    add_menu_page( ‘Reposting’, ‘Reposting’, ‘publish_posts’, ‘atcontent/repost.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ), 7 );
    
    changed to
    
    add_menu_page( ‘CopyLocator’, ‘CopyLocator’, ‘publish_posts’, ‘atcontent/copylocator.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ) );
    
    add_menu_page( ‘Guest Posts’, ‘Guest Posts’, ‘publish_posts’, ‘atcontent/guestpost.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ) );
    
    add_menu_page( ‘Reposting’, ‘Reposting’, ‘publish_posts’, ‘atcontent/repost.php’, ’’, plugins_url( ‘assets/logo.png’, FILE ) );


    [please use the code buttons and links correctly]

    http://wordpress.org/plugins/atcontent/

  2. freerange
    Member
    Posted 9 months ago #

    We had a similar problem withe the Repost plugin[*]

    The issue is that menu positions a limited namespace and if you add something at position 5 it might conflict withe another plugin. The trick is to find a menu key that's not in use. Here is the code we use:

    /**
    		 * This is a weirdness that needs an explanation, there is no easy way to say "just after
    		 * the posts menu item" so we have to specify an offset into the menu array.  Now if we use an
    		 * int there is a very high probability that it will conflict with another menu and one or other
    		 * will get stomped.  To avoid this we use a float, but it's not that simple becasue if we just
    		 * use a float php will turn it into an int when the array gets set so we have to use a float in the
    		 * form of a string and it has to be a number that nobody else in likly to be using to avoid a collision.
    		 *
    		 * So we look in the menu array (ugh!) see what is used starting from the numbr 5 "Posts" entry
    		 * and add a small amount until we find a free key.
    		 *
    		 * Easy eh!
    		 **/
    		global $menu;
    		$menukey = 5.0;
    		while(array_key_exists((string) $menukey,$menu)) {
    			$menukey += 0.0000000001;
    		}
    		$menukey = (string) $menukey;  //If it's not a string it gets rounded to an int!
    		add_menu_page(
                            __(self::NAME . " Syndication"),
                            __("Content Feeds"),
                            "edit_posts",
    			self::ID . "-content",
    			array(&$this, 'repost_content'),
                            plugins_url(  "/images/repost_bttn_tiny.png", __FILE__),
                            $menukey
    		);

    enjoy!

    [* I have a trigger on posts that mention Repost which is how I saw this)].

  3. Vadim Novitskiy
    Member
    Plugin Author

    Posted 9 months ago #

    Hi guys!

    Thanks for your feedback! We will resolve this issue soon :)

  4. Vadim Novitskiy
    Member
    Plugin Author

    Posted 9 months ago #

    Hi again!

    I'm grad to say problem is resolved! :)

    Thanks a lot for this feedback!

Reply

You must log in to post.

About this Plugin

About this Topic