graftee filters

graftee by making a lot of filters, we have limited the things that theme is condemned only to mark up.
Also all the wording can be changed freely in the child theme by the filter.

graftee_header_param

This filter is changes nav position in markup.
If returned ‘first-nav’, nav position is before header element.
default position is after header element.

example code(read header-first-nav.php file)

function my_graftee_header_param() {
    return 'first-nav';
}

add_filter( 'graftee_header_param', 'my_graftee_header_param' );

graftee_blogname

This filter is changes blog name.
In source, ‘body > header > p’

example code

function my_graftee_blogname( $output ) {
    return $output . '|hoge';
}

add_filter( 'graftee_blogname', 'my_graftee_blogname' );

graftee_get_footer_html

This filter is changes footer credit.

example code

function my_graftee_get_footer_html( $output ) {
    $html = '<p>';
    $html .= '<small>hoge</small>';
    $html .= '</p>';

    return $html;
}

add_filter( 'graftee_get_footer_html', 'my_graftee_get_footer_html' );

graftee_custom_background_args

This filter is changes default custom-background in add_theme_support.

example code

function my_graftee_custom_background_args( $arg ) {
    $arg['default-color'] = 'fff';

    return $arg;
}

add_filter( 'graftee_custom_background_args', 'my_graftee_custom_background_args' );

graftee_custom_header_args

This filter is changes default custom-header in add_theme_support.

example code

function my_graftee_custom_header_args( $arg ) {
    $arg['default-text-color'] = '000';

    return $arg;
}

add_filter( 'graftee_custom_header_args', 'my_graftee_custom_header_args' );

graftee_get_public_word_full

Chage all public word.
word is using in this theme.

this is word list
format is ‘word,type’

  • article list,article-list
  • %d comments,n-comments
  • Older Comments,older-comments
  • Newer Comments,newer-comments
  • Comments are closed.,close-comments
  • comment,comment
  • Name,name
  • Email,email
  • Sory, Content not found.,not-found
  • article search,search-article
  • READ POST,read-post
  • <h2>Category</h2>,category
  • <h2>Tag</h2>,tag
  • To the top,to-the-top
  • Skip to content,skip-to-content
  • Primary Menu,primary-menu
  • Search Results of ” %s “,search-result
  • %d posts,n-posts
  • 404 Not found,404
  • This article,this-article
  • Nothing Found,not-found2
  • Page %d,n-pages

example code

function my_graftee_get_public_word_full( $type ) {
    $result = '';

    switch ( $type ) {
        case 'article-list'
            $result = 'hoge';
            break;
        case ...
    }

    return $result;
}

add_filter( 'graftee_get_public_word_full', 'my_graftee_get_public_word_full' );

graftee_get_public_word

Chage a public word.
The version of the only one of graftee_get_public_word_full.

example code

function my_graftee_get_public_word( $result, $type ) {
    if ( $type == 'article-list' ) {
        $result = 'hoge';
    }

    return $result;
}

add_filter( 'graftee_get_public_word', 'my_graftee_get_public_word' );

graftee_get_admin_word_full

The version of the event editor of graftee_get_public_word_full.
event editor is in create post page.

this is word list
format is ‘word,type’

  • Event Name,event-name
  • Start Time,start-time
  • End Time,end-time
  • Event Info,event-info
  • It can also be edited in the editor side after writing,event-message
  • Export,export

example code

function my_graftee_get_admin_word_full( $type ) {
    $result = '';

    switch ( $type ) {
        case 'event-name'
            $result = 'hoge';
            break;
        case ...
    }

    return $result;
}

add_filter( 'graftee_get_admin_word_full', 'my_graftee_get_admin_word_full' );

graftee_get_admin_word

The version of the only one of graftee_get_admin_word_full.

example code

function my_graftee_get_admin_word( $result, $type ) {
    if ( $type == 'event-name' ) {
        $result = 'hoge';
    }

    return $result;
}

add_filter( 'graftee_get_admin_word', 'my_graftee_get_admin_word' );
広告