Ejemplo n.º 1
0
/**
 * Register all the meta boxes for the Download custom post type
 *
 * @since  1.0
 * @author Bryan Monzon
 * @return void
 */
function egt_add_meta_box()
{
    $post_types = apply_filters('egt_metabox_post_types', array('campaigns'));
    foreach ($post_types as $post_type) {
        /** Class Configuration */
        add_meta_box('campaigndetails', sprintf(__('%1$s Details', 'egt'), egt_get_label_singular(), egt_get_label_plural()), 'egt_render_meta_box', $post_type, 'side', 'core');
        add_meta_box('donorlist', 'Donor List', 'egt_render_donor_list_meta_box', $post_type, 'normal', 'core');
    }
}
Ejemplo n.º 2
0
/**
 * Updated Messages
 *
 * Returns an array of with all updated messages.
 *
 * @since  1.0
 * @author Bryan Monzon
 * @param array $messages Post updated message
 * @return array $messages New post updated messages
 */
function egt_updated_messages($messages)
{
    global $post, $post_ID;
    $url1 = '<a href="' . get_permalink($post_ID) . '">';
    $url2 = egt_get_label_singular();
    $url3 = '</a>';
    $messages['campaigns'] = array(1 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'egt'), $url1, $url2, $url3), 4 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'egt'), $url1, $url2, $url3), 6 => sprintf(__('%2$s published. %1$sView %2$s%3$s.', 'egt'), $url1, $url2, $url3), 7 => sprintf(__('%2$s saved. %1$sView %2$s%3$s.', 'egt'), $url1, $url2, $url3), 8 => sprintf(__('%2$s submitted. %1$sView %2$s%3$s.', 'egt'), $url1, $url2, $url3));
    return $messages;
}
/**
 * Retrieve the array of plugin settings
 *
 * @since  1.0
 * @author Bryan Monzon
 * @return array
*/
function egt_get_registered_settings()
{
    $pages = get_pages();
    $pages_options = array(0 => '');
    // Blank option
    if ($pages) {
        foreach ($pages as $page) {
            $pages_options[$page->ID] = $page->post_title;
        }
    }
    if (class_exists('RGFormsModel')) {
        $form_options = array(0 => '');
        // Blank option
        $forms = RGFormsModel::get_forms(null, 'title');
        if ($forms) {
            foreach ($forms as $form) {
                $form_options[$form->id] = $form->title;
            }
        }
    }
    /**
     * 'Whitelisted' EGT settings, filters are provided for each settings
     * section to allow extensions and other plugins to add their own settings
     */
    $egt_settings = array('general' => apply_filters('egt_settings_general', array('basic_settings' => array('id' => 'basic_settings', 'name' => '<strong>' . __('Basic Settings', 'egt') . '</strong>', 'desc' => '', 'type' => 'header'), 'team' => array('id' => 'team', 'name' => __(egt_get_label_plural() . ' URL Slug', 'egt'), 'desc' => __('Enter the slug you would like to use for your ' . strtolower(egt_get_label_plural()) . '. (<em>You will need to <a href="' . admin_url('options-permalink.php') . '">refresh permalinks</a>, after saving changes</em>).', 'egt'), 'type' => 'text', 'size' => 'medium', 'std' => strtolower(egt_get_label_plural())), 'team_label_plural' => array('id' => 'team_label_plural', 'name' => __(egt_get_label_plural() . ' Label Plural', 'egt'), 'desc' => __('Enter the label you would like to use for your ' . strtolower(egt_get_label_plural()) . '.', 'egt'), 'type' => 'text', 'size' => 'medium', 'std' => egt_get_label_plural()), 'team_label_singular' => array('id' => 'team_label_singular', 'name' => __(egt_get_label_singular() . ' Label Singular', 'egt'), 'desc' => __('Enter the label you would like to use for your ' . strtolower(egt_get_label_singular()) . '.', 'egt'), 'type' => 'text', 'size' => 'medium', 'std' => egt_get_label_singular()), 'disable_archive' => array('id' => 'disable_archive', 'name' => __('Disable Archives Page', 'egt'), 'desc' => __('Check to disable archives page. (<em>You might need to <a href="' . admin_url('options-permalink.php') . '">refresh permalinks</a>, after saving changes</em>).', 'egt'), 'type' => 'checkbox', 'std' => ''), 'exclude_from_search' => array('id' => 'exclude_from_search', 'name' => __('Exclude from Search', 'egt'), 'desc' => __('Check to exclude from search. (<em>You might need to <a href="' . admin_url('options-permalink.php') . '">refresh permalinks</a>, after saving changes</em>)', 'egt'), 'type' => 'checkbox', 'std' => ''))));
    return $egt_settings;
}