Support » Plugin: Permalink Manager Lite » How to export the {customuri[1]}

  • Resolved furnituresuppliesuk

    (@furnituresuppliesuk)


    Hello,

    I have been working on a test site, now I have a structure I am happy with I want to export the products and x50 product categories to clean install however after importing the categories to new site everything seem to look good until I imported products and the category count went from x50 to 70+ with category items that seem to be using old url.

    I found your instructions which says to use {customuri[1]} in the custom url field of wp all import plugin however when I export/ migrate products/ categories with wp all
    export I do not see a column in the files with {customuri[1]}.

    Maybe I am simply misunderstanding.

    Can you advise what I am doing wrong please.

    Many thanks, and great plugin by the way, I hope to purchase pro some time πŸ™‚

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @furnituresuppliesuk,

    There was almost no documentation on API functions of WP All Export plugin, so I decided to take care of this later πŸ˜‰ Finally, I have completely forgotten about it.

    If you would like to export “Custom URI” via WP All Export you will need the custom snippet – you can find it below. Please paste it to functions.php in your (child) theme directory.

    I will include it in (probably) next version of plugin.

    Best regards,
    Maciej

    /**
     * Export custom permalinks
     */
    function wpae_custom_uri_section($sections) {
    	if(is_array($sections)) {
    		$sections['permalink_manager'] = array(
    			'title'   => __('Permalink Manager', 'permalink-manager'),
    			'content' => 'permalink_manager_fields'
    		);
    	}
    
    	return $sections;
    }
    add_filter('pmxe_available_sections', 'wpae_custom_uri_section', 9);
    
    function wpae_custom_uri_section_fields($fields) {
    	if(is_array($fields)) {
    		$fields['permalink_manager_fields'] = array(
    			array(
    				'label' => 'custom_uri',
    				'name'  => 'Custom URI',
    				'type'  => 'custom_uri'
    			)
    		);
    	}
    
    	return $fields;
    }
    add_filter('wp_all_export_available_data', 'wpae_custom_uri_section_fields', 9);
    
    function wpae_export_custom_uri($articles, $options) {
    	foreach($articles as &$article) {
    		if(!empty($article['id'])) {
    			$article['Custom URI'] = Permalink_Manager_URI_Functions_Post::get_post_uri($article['id']);
    		}
    	}
    
    	return $articles;
    }
    add_filter('wp_all_export_csv_rows', 'wpae_export_custom_uri', 10, 2);
    Thread Starter furnituresuppliesuk

    (@furnituresuppliesuk)

    Hello Maciej (@mbis),
    Thank you for the fast response,

    To be honest I am quiet glad to hear that it wasn’t just me. I thought I had gone mad! haha

    I add the code you kindly provided to code snippets plugin, I dodnt see any changes so I changed priority from 10 to 1 unfortunately I still do not see “Custom URI”.

    I also tried to add the snippet to WP All Import itself to no avail.

    Has the code been tested? Maybe you can guide me further please.

    Thank you πŸ™‚

    Plugin Author Maciej Bis

    (@mbis)

    Hi @furnituresuppliesuk,

    I tested it with WP All Export 1.2.7 version. The “Custom URI” field should be available from the sidebar:

    Best regards,
    Maciej

    Thread Starter furnituresuppliesuk

    (@furnituresuppliesuk)

    Sorry here is some more information.

    Steps I had taken

    1. New Export
    2. Woocommerce Products
    3. Customize Export File
    4. I do not see β€œCustom URI”

    If I repeat the steps above with code snippet enabled and select “Preview”, I get an error returned without any preview being displayed.

    “An unknown error occured”

    Kind regards,

    Lee πŸ™‚

    Thread Starter furnituresuppliesuk

    (@furnituresuppliesuk)

    My bad! I just installed the latest version from repository and I see the “Custom URL” πŸ˜€

    Thank you so much, excellent support, I will definitely be purchasing pro version in the near future.

    Kind regards,

    Lee

    Plugin Author Maciej Bis

    (@mbis)

    Hi @furnituresuppliesuk,

    No problem at all, I am happy to help πŸ˜‰

    Best regards,
    Maciej

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