Support » Localhost Installs » Weird localhost plugin problem I can’t seem to duplicate

  • Resolved figure2

    (@figure2)


    Hello all,

    I created a simple custom post type for a portfolio and am having a weird problem with the Plugin URI link.

    First, here is my plugin code:

    <?php
    /*
     * Plugin Name: Portfolio
     * Plugin URI: https://www.markhannondesign.com
     * Description: Creates a portfolio custom post type
     * Version: 1.0
     * Author: Mark Hannon
     * Author URI: https://www.markhannondesign.com
     * License: GPLv2
    */
    
    add_action( 'init', 'portfolio_post_type' ); // hook function call
    
    function portfolio_post_type() { // opening post type function
    	register_post_type( 'portfolio', 
    	    array( //opening enclosing array
            	 
            	'labels' => array( // opening labels array
            	 'name'  => 'Portfolios',
                     'singular_name' => 'Portfolio',
                     'add_new' => 'Add New',
    		 'add_new_item' => 'Add New Portfolio',
    		 'edit' => 'Edit',
    		 'edit_item' => 'Edit Portfolio',
    		 'new_item' => 'New Portfolio',
    		 'view' => 'View',
    		 'view_item' => 'View Portfolio',
    		 'search_items' => 'Search Portfolios',
    		 'not_found' => 'No Portfolios found',
    		 'not_found_in_trash'=> 'No Portfolios found in Trash',
    		 'parent' => 'Parent Portfolio',
    					
                	), // closing labels array
    			
    		'public' => true,
                    'show_ui' => true,
                    'menu_position' => 5,
                    'hierarchical' => false,
                    'supports' => array( 'title',
                                         'editor',
                                         'excerpt',
                                         'custom-fields',
                                         'thumbnail' ),
                    'taxonomies' => array( 'post_tag', 'category'),
                    'menu_icon' => 'dashicons-art',
                    'has_archive' => true,
                'capability_type' => 'post'
                
    		) //ending enclosing array
    		
    	); //closing register_post_type() function call
    	
    } // closing post type function
    ?>

    The comments are just for me to keep the opening and closing parentheses straight.

    What is happening on only one of my MAMP websites is that the Plugin URI link is pointing to the “Portfolio by BestWebSoft” plugin page instead of my website as set in the plugin comments.

    See the screenshot here.

    This is only happening in only one MAMP website. I tested the plugin in a second MAMP account and also a copy of the website on a sub domain on my website, and the Plugin URI link is correct on those sites.

    Any idea what is going on?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steve Stern

    (@sterndata)

    Guardian of the Interwebs

    If you’re using a plugin with the same name as one in the wp.org repository, things may get confused. Rename the plugin to something like MHD_Portfolio.

    Actually you set me on the right track. I was able to keep the name of the plugin “Portfolio” inside the opening comments in the PHP file as long as I renamed the php file itself from “portfolio.php” to “mhd-portfolio.php.”

    The incorrect Plugin URI link is gone.

    Thanks, by the way.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.