}
        }
        return wp_kses_post($upgrade_notice);
    }
    /**
     * Display action links in the Plugins list table.
     * @param  array $actions
     * @return array
     */
    public static function plugin_action_links($actions)
    {
        $new_actions = array('settings' => '<a href="' . admin_url('admin.php?page=rp-settings') . '" title="' . esc_attr(__('View RestaurantPress Settings', 'restaurantpress')) . '">' . __('Settings', 'restaurantpress') . '</a>');
        return array_merge($new_actions, $actions);
    }
    /**
     * Display row meta in the Plugins list table.
     * @param  array  $plugin_meta
     * @param  string $plugin_file
     * @return array
     */
    public static function plugin_row_meta($plugin_meta, $plugin_file)
    {
        if ($plugin_file == RP_PLUGIN_BASENAME) {
            $new_plugin_meta = array('docs' => '<a href="' . esc_url(apply_filters('restaurantpress_docs_url', 'http://themegrill.com/docs/restaurantpress/')) . '" title="' . esc_attr(__('View RestaurantPress Documentation', 'restaurantpress')) . '">' . __('Docs', 'restaurantpress') . '</a>', 'support' => '<a href="' . esc_url(apply_filters('restaurantpress_support_url', 'http://themegrill.com/support-forum/')) . '" title="' . esc_attr(__('Visit Free Customer Support Forum', 'restaurantpress')) . '">' . __('Free Support', 'restaurantpress') . '</a>');
            return array_merge($plugin_meta, $new_plugin_meta);
        }
        return (array) $plugin_meta;
    }
}
RP_Install::init();
Example #2
0
 * Uninstalls the plugin deletes user roles, tables, and options.
 *
 * @author   ThemeGrill
 * @category Core
 * @package  RestaurantPress/Uninstaller
 * @version  1.0.0
 */
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
global $wpdb, $wp_version;
$uninstall_data = apply_filters('restaurantpress_uninstall_data', true);
if ($uninstall_data) {
    // Roles + caps.
    include_once 'includes/class-rp-install.php';
    RP_Install::remove_roles();
    // Tables.
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}restaurantpress_termmeta");
    // Delete options.
    $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'restaurantpress\\_%';");
    // Delete posts + data.
    $wpdb->query("DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'food_menu', 'food_group' );");
    $wpdb->query("DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;");
    // Delete terms if > WP 4.2 (term splitting was added in 4.2)
    if (version_compare($wp_version, '4.2', '>=')) {
        // Delete term taxonomies
        $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => 'food_menu_cat'));
        // Delete orphan relationships
        $wpdb->query("DELETE tr FROM {$wpdb->term_relationships} tr LEFT JOIN {$wpdb->posts} posts ON posts.ID = tr.object_id WHERE posts.ID IS NULL;");
        // Delete orphan terms
        $wpdb->query("DELETE t FROM {$wpdb->terms} t LEFT JOIN {$wpdb->term_taxonomy} tt ON t.term_id = tt.term_id WHERE tt.term_id IS NULL;");