• Resolved gharish

    (@gharish)


    Hi, Can any one help me, how can i enable “pods > components > Migrate: Packages” through pods api( pro grammatically) not to the pods settings.
    It is very useful to our one click demo installation. I am installing pods one click demo perfectly using below pods api

    
    public function import_package ( $data = false, $replace = false )  
    

    but doing this pods one click we need to enable mandatory the “pods > components > Migrate: Packages”.

    If it is any possible to enable pods > components > Migrate: Packages” through any pods api it very helpful to us.

    Thankyou.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Bernhard Gronau

    (@quasel)

    well once 2.7 is released it will be enabled per default! Not sure about your timetable ??

    PodsInit::$components->activate_component( 'templates' ); from https://github.com/pods-framework/pods/pull/4060

    Plugin Contributor Jim True

    (@jimtrue)

    That’s Pods Templates, not Migrate: Packages, though the same action would be what you’re looking for in activating Packages through code.It would probably be PodsInit::$components->activate_component('migrate_packages');

    Plugin Contributor Bernhard Gronau

    (@quasel)

    oups, sorry – thx for correcting me! ??

    Thread Starter gharish

    (@gharish)

    I had added the below code in my theme functions.php file but it’s not working.

    
    PodsInit::$components->activate_component('migrate_packages');
    

    After Added this code, I have remove my database completely and install the wordpress newly but no luck.

    I have tried to different ways to activate “migrate_packages” using the above code.

    can you help me how can i use that code to activate migrate_packages ?

    Thankyou.

    • This reply was modified 7 years, 8 months ago by gharish.
    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Marked as not resolved so we can be sure the right answer gets posted here.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    You can use the following code:

    
    $component_to_auto_activate = 'migrate-packages';
    
    // Auto activate component.
    if ( empty( PodsInit::$components ) ) {
    	if ( ! defined( 'PODS_LIGHT' ) || ! PODS_LIGHT ) {
    		PodsInit::$components = pods_components();
    	}
    }
    
    if ( ! empty( PodsInit::$components ) ) {
    	PodsInit::$components->activate_component( $component_to_auto_activate );
    }
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Enable pods components Migrate: Packages through PODS API’ is closed to new replies.