示例#1
0
<?php

// Important: Check if the file is the one
// that was registered during the uninstall hook.
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
if (!current_user_can('activate_plugins')) {
    exit;
}
check_admin_referer('bulk-plugins');
global $wpdb;
// UNAPPLYING ALL THE MOLDS
$mold = new WC_Molds();
$molds = $wpdb->get_results('SELECT meta_id FROM ' . $wpdb->prefix . 'postmeta WHERE meta_key = "_mold"');
foreach ($molds as $mold) {
    $mold->pm_load_from_db($mold->meta_id);
    $mold->pm_unapply_mold();
}
// DELETING ALL THE MOLDS
$wpdb->query('DELETE FROM ' . $wpdb->prefix . 'postmeta WHERE meta_key = "_mold"');
示例#2
0
<?php 
include 'css/admin.css';
?>
</style>

<script>
<?php 
include 'js/admin.js';
?>
</script>

<div class="wrap"> 

	<?php 
// CREATING MOLD OBJECT //
$mold = new WC_Molds();
###################
## NEW MOLD PAGE ##
###################
if (isset($_POST['action']) && ($_POST['action'] == 'new' || $_POST['action'] == 'edit')) {
    // PAGE TITLE //
    ?>
		<h2><img style="margin-right:2px;vertical-align:bottom;" src="<?php 
    echo bloginfo('wpurl');
    ?>
/wp-content/plugins/woocommerce-molds/assets/images/molds.png">
		<?php 
    if ($_POST['action'] == 'new') {
        echo "" . __('New mold', 'woocommerce-molds') . "</h2>";
        ## We load the temporary database ##
        $mold->pm_load_temporary_save();