Skip to content

Instantly share code, notes, and snippets.

@rayhanuddin2019
Last active October 5, 2022 11:47
Show Gist options
  • Save rayhanuddin2019/c1053b96b5d1b67bfda9963eb9cb43f0 to your computer and use it in GitHub Desktop.
Save rayhanuddin2019/c1053b96b5d1b67bfda9963eb9cb43f0 to your computer and use it in GitHub Desktop.

Revisions

  1. rayhanuddin2019 revised this gist Oct 5, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wp-manuall-plugin-install
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@

    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin={plugin_slug}' ), 'install-plugin_{plugin_slug}' );

    ----------------- Second solution -------------------
    ----------------- Second solution -------------------

    $action = 'install-plugin';
    $slug = 'akismet';
  2. rayhanuddin2019 revised this gist Oct 5, 2022. No changes.
  3. rayhanuddin2019 revised this gist Oct 5, 2022. 1 changed file with 18 additions and 3 deletions.
    21 changes: 18 additions & 3 deletions wp-manuall-plugin-install
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,21 @@
    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=automatic-youtube-gallery' ), 'install-plugin_automatic-youtube-gallery' );
    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=automatic-youtube-gallery' ), 'install-plugin_automatic-youtube-gallery' );


    Below you’ll find a function that generates a plugin install link for WordPress. You can use this in the dashboard. This link acts the same way as the “Install plugin” buttons when searching for plugins within WordPress.
    Below you’ll find a function that generates a plugin install link for WordPress. You can use this in the dashboard. This link acts the same way as the “Install plugin” buttons when searching for plugins within WordPress.

    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin={plugin_slug}' ), 'install-plugin_{plugin_slug}' );
    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin={plugin_slug}' ), 'install-plugin_{plugin_slug}' );

    ----------------- Second solution -------------------

    $action = 'install-plugin';
    $slug = 'akismet';
    $url = wp_nonce_url(
    add_query_arg(
    array(
    'action' => $action,
    'plugin' => $slug
    ),
    admin_url( 'update.php' )
    ),
    $action.'_'.$slug
    );
  4. rayhanuddin2019 created this gist Oct 5, 2022.
    6 changes: 6 additions & 0 deletions wp-manuall-plugin-install
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=automatic-youtube-gallery' ), 'install-plugin_automatic-youtube-gallery' );


    Below you’ll find a function that generates a plugin install link for WordPress. You can use this in the dashboard. This link acts the same way as the “Install plugin” buttons when searching for plugins within WordPress.

    $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin={plugin_slug}' ), 'install-plugin_{plugin_slug}' );