Skip to content

Instantly share code, notes, and snippets.

@tribulant
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tribulant/05e4e0ef4ca0d99e82cc to your computer and use it in GitHub Desktop.
Save tribulant/05e4e0ef4ca0d99e82cc to your computer and use it in GitHub Desktop.
checkout_extensions_list
<?php
function extensions_list($extensions = array()) {
$extensions['guestcheckout'] = array(
'name' => "Guest Checkout",
'link' => "http://domain.com",
'image' => plugins_url() . '/mypmethod/images/icon.png',
'description' => __("My Payment Method for the Shopping Cart plugin.", 'mypmethod'),
'slug' => 'mypmethod',
'plugin_name' => 'mypmethod',
'plugin_file' => 'mypmethod.php',
'settings' => '?page=link-to-settings-page',
);
$titles = array();
foreach ($extensions as $extension) {
$titles[] = $extension['name'];
}
array_multisort($titles, SORT_ASC, $extensions);
return $extensions;
}
add_filter('checkout_extensions_list', 'extensions_list', 10, 1);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment