Exemplo n.º 1
0
 /**
  * Does initial setup on activation of the plugin
  */
 public function do_activation()
 {
     require_once $this->plugin_path . 'admin/mpp-admin-install.php';
     mpp_upgrade_legacy_1_0_b1_activity();
     //post type
     require_once $this->plugin_path . 'core/common/mpp-common-functions.php';
     require_once $this->plugin_path . 'core/mpp-post-type.php';
     //store default settings if not already exists
     add_option('mpp-settings', mpp_get_all_options());
     //initialize post type( because we want to flush the rewrite rules)
     MPP_Post_Type_Helper::get_instance()->init();
     //rewrite end points
     add_rewrite_endpoint('manage', EP_PERMALINK);
     add_rewrite_endpoint('media', EP_PERMALINK);
     flush_rewrite_rules();
     //multiple terms creation by WordPress is too much db intensive, let us do it lightly
     mpp_install_terms();
     //on activation, create logger table
     mpp_install_db();
 }
Exemplo n.º 2
0
    foreach ($plugins as $plugin_path) {
        $plugin_base = plugin_basename($plugin_path);
        // If the plugin isn't active, don't show it.
        if (!array_key_exists($plugin_base, $active_plugins)) {
            continue;
        }
        $plugin = get_plugin_data($plugin_path);
        echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
    }
}
?>

// MediaPress Settings //

<?php 
$settings = mpp_get_all_options();
foreach ($settings as $key => $value) {
    echo $key . ':		' . mpp_array_to_string($value) . "\n";
}
?>

// End of MediaPress Settings //

<?php 
if (has_action('mpp_admin_debug_extra')) {
    echo "\n";
    do_action('mpp_admin_debug_extra');
}
function mpp_get_yes_no_from_boolean($what)
{
    if ($what) {
Exemplo n.º 3
0
/**
 * Update individual MediaPress option and save that to database( in options table )
 * 
 * @param type $option_name
 * @param type $value
 */
function mpp_update_option($option_name, $value)
{
    $options = mpp_get_all_options();
    $options[$option_name] = $value;
    mpp_save_options($options);
}
Exemplo n.º 4
0
 public function do_activation()
 {
     require_once $this->plugin_path . 'admin/mpp-admin-install.php';
     mpp_upgrade_legacy_1_0_b1_activity();
     //post type
     require_once $this->plugin_path . 'core/common/mpp-common-functions.php';
     require_once $this->plugin_path . 'core/mpp-post-type.php';
     add_option('mpp-settings', mpp_get_all_options());
     MPP_Post_Type_Helper::get_instance()->init();
     //rewrite end points
     add_rewrite_endpoint('manage', EP_PERMALINK);
     add_rewrite_endpoint('media', EP_PERMALINK);
     flush_rewrite_rules();
     //on activation, create logger table
     mpp_install_terms();
     mpp_install_db();
 }