예제 #1
0
파일: terms.php 프로젝트: synapticism/ubik
                $content = sprintf('<span class="p-category"><a href="%s" rel="tag">%s</a></span>', get_term_link($term, $taxonomy), $content);
            }
            // Return whatever we have (which might only be the original contents of the shortcode when there is no term matched)
            return apply_filters('ubik_taxonomy_shortcode', apply_filters('ubik_{$taxonomy}_shortcode', $content));
        });
    }
}
// == VARIOUS == //
// Allow user configuration to override the categorization check
if ($options['categorized'] === false) {
    add_filter('ubik_categorized', '__return_false');
}
// Automatically hide categories filter on single category blogs
if (is_admin() && \Ubik\is_categorized() === false) {
    add_action('admin_head-edit.php', function () {
        echo \Ubik\get_wrap('css', 'select#cat { display: none; }');
    });
}
// Allow shortcodes in term descriptions; be forewarned that you can trigger an infinite loop by filtering additional term-related stuff this way
if ($options['description_shortcodes']) {
    add_filter('term_description', 'shortcode_unautop');
    add_filter('term_description', 'do_shortcode');
}
// A simple helper function that allows for mass filtering of term names and descriptions exclusively on the front-end
// This was developed for use with Markdown transformations and CJK character wrapping but you can use it for whatever
// @filter: ubik_terms_display_name
// @filter: ubik_terms_display_description
function display_terms_filter($term)
{
    if (!is_admin() && !is_feed()) {
        $term->name = apply_filters('ubik_terms_display_name', $term->name);
예제 #2
0
파일: google.php 프로젝트: synapticism/ubik
function fonts_import($url = '')
{
    if (empty($url)) {
        $url = get_fonts_url();
    }
    if ($url) {
        echo \Ubik\get_wrap('css', sprintf('@import url(%s);', $url));
    }
}
예제 #3
0
function quick_edit_html($column, $screen, $taxonomy = [])
{
    // Check to see if we're in the right place; this function is called on any view where a custom column is registered (including views for which the $taxonomy is undefined)
    if (empty($taxonomy) || $screen !== 'edit-tags' || $column !== '_description') {
        return;
    }
    // Fetch the target taxonomy and ensure the current user can edit terms
    $tax = get_taxonomy($taxonomy);
    if (!current_user_can($tax->cap->edit_terms)) {
        return;
    }
    // Output term description field
    ?>
<fieldset>
    <div class="inline-edit-col">
    <label>
      <span class="title"><?php 
    _e('Description', 'ubik');
    ?>
</span>
      <span class="input-text-wrap">
        <textarea id="description_term" name="description" rows="3" class="ptitle"></textarea>
      </span>
    </label>
    </div>
  </fieldset><?php 
    // Find the contents of the hidden column and copy this to the inline description field after the user clicks on the quick edit link
    echo \Ubik\get_wrap('jquery', "\$('#the-list').on('click', 'a.editinline', function(){ var now = \$(this).closest('tr').find('td.column-_description').text(); \$('#description_term').text(now); } );");
}
예제 #4
0
파일: admin.php 프로젝트: synapticism/ubik
function post_list_thumbnail_columns_style()
{
    echo \Ubik\get_wrap('css', apply_filters('ubik_admin_post_list_thumbnail_style', '.column-featured_image { width: ' . option('post_list_thumbnail_size') . 'px; } td.column-featured_image { text-align: center; }'));
}