added prefix tainacan in functions, options, variable and others

This commit is contained in:
Fabiano 2018-10-03 11:13:26 -03:00
parent 24faf62287
commit 1469c28e0a
8 changed files with 30 additions and 33 deletions

View File

@ -8,10 +8,10 @@
<main role="main" class="mt-5 max-large margin-one-column">
<div class="row">
<div class="col-12 <?php if ( is_active_sidebar( 'sidebar-right' ) ) { ?>col-lg-9<?php } ?>">
<div class="col-12 <?php if ( is_active_sidebar( 'tainacan-sidebar-right' ) ) { ?>col-lg-9<?php } ?>">
<?php get_template_part( 'template-parts/loop' ); ?>
</div>
<?php if ( is_active_sidebar( 'sidebar-right' ) ) { get_sidebar(); } ?>
<?php if ( is_active_sidebar( 'tainacan-sidebar-right' ) ) { get_sidebar(); } ?>
</div>
</main>
<?php get_footer();

View File

@ -1,10 +1,10 @@
<?php if ( ! is_404() ) : ?>
<footer class="container-fluid p-4 p-sm-5 mt-5 tainacan-footer" style="padding-bottom: 0 !important;">
<?php if ( is_active_sidebar( 'footer-1' ) ) { ?>
<?php if ( is_active_sidebar( 'tainacan-sidebar-footer' ) ) { ?>
<div class="row">
<div class="col-12 col-lg">
<ul class="p-4 d-lg-flex justify-content-md-center mb-md-0">
<?php dynamic_sidebar( 'footer-1' ); ?>
<?php dynamic_sidebar( 'tainacan-sidebar-footer' ); ?>
</ul>
</div>
</div>

View File

@ -94,7 +94,7 @@ if ( ! isset( $content_width ) ) {
function tainacan_widgets_sidebar_init() {
register_sidebar( array(
'name' => __( 'Tainacan Sidebar Right', 'tainacan-interface' ),
'id' => 'sidebar-right',
'id' => 'tainacan-sidebar-right',
'before_widget' => '<aside id="%1$s" class="pb-4 pl-4 widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title font-weight-bold">',
@ -109,7 +109,7 @@ add_action( 'widgets_init', 'tainacan_widgets_sidebar_init' );
function tainacan_widgets_footer_init() {
register_sidebar( array(
'name' => __( 'Tainacan Sidebar Footer', 'tainacan-interface' ),
'id' => 'footer-1',
'id' => 'tainacan-sidebar-footer',
'before_widget' => '<li class="border-left-0 border-right-0 tainacan-side"><input type="checkbox" checked><i></i>',
'after_widget' => '</li>',
'before_title' => '<h6 class="text-white font-weight-bold mb-lg-4">',

View File

@ -2,8 +2,8 @@
class TainacanThemeCollectionColor {
public $background_color = 'tainacan_theme_collection_background_color';
public $text_color = 'tainacan_theme_collection_color';
public $tainacan_background_color = 'tainacan_theme_collection_background_color';
public $tainacan_text_color = 'tainacan_theme_collection_color';
function __construct() {
add_filter( 'tainacan-api-response-collection-meta', array( $this, 'add_meta_to_response' ), 10, 2 );
@ -64,7 +64,7 @@ class TainacanThemeCollectionColor {
</span>
<div class="control is-clearfix">
<p style="font-weight: 600;"><?php _e( 'Picker color', 'tainacan-interface' ); ?></p>
<input type="text" value="" id="colorpicker" name="<?php echo $this->background_color; ?>">
<input type="text" value="" id="colorpicker" name="<?php echo $this->tainacan_background_color; ?>">
</div>
</div>
@ -89,13 +89,13 @@ class TainacanThemeCollectionColor {
<input
type="radio"
value="#fff"
name="<?php echo $this->text_color; ?>"
name="<?php echo $this->tainacan_text_color; ?>"
id="white" checked>
<label for="white" id="color-white" class="color-text"><?php _e( 'White', 'tainacan-interface' ); ?></label>
<input
type="radio"
value="#000"
name="<?php echo $this->text_color; ?>"
name="<?php echo $this->tainacan_text_color; ?>"
id="black">
<label for="black" id="color-black" class="color-text"><?php _e( 'Black', 'tainacan-interface' ); ?></label>
</div>
@ -109,8 +109,8 @@ class TainacanThemeCollectionColor {
function add_meta_to_response( $extra_meta, $request ) {
$extra_meta = array(
$this->background_color,
$this->text_color,
$this->tainacan_background_color,
$this->tainacan_text_color,
);
return $extra_meta;
}
@ -123,11 +123,11 @@ class TainacanThemeCollectionColor {
$post = tainacan_get_api_postdata();
if ( $object->can_edit() ) {
if ( isset( $post->{$this->background_color} ) ) {
update_post_meta( $object->get_id(), $this->background_color, $post->{$this->background_color} );
if ( isset( $post->{$this->tainacan_background_color} ) ) {
update_post_meta( $object->get_id(), $this->tainacan_background_color, $post->{$this->tainacan_background_color} );
}
if ( isset( $post->{$this->text_color} ) ) {
update_post_meta( $object->get_id(), $this->text_color, $post->{$this->text_color} );
if ( isset( $post->{$this->tainacan_text_color} ) ) {
update_post_meta( $object->get_id(), $this->tainacan_text_color, $post->{$this->tainacan_text_color} );
}
}

View File

@ -76,7 +76,7 @@ function tainacan_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'display_powered', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'display_callback_sanitize_checkbox',
'sanitize_callback' => 'tainacan_display_callback_sanitize_checkbox',
) );
$wp_customize->add_control( 'display_powered', array(
@ -100,7 +100,7 @@ function tainacan_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'facebook_share', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'display_callback_sanitize_checkbox',
'sanitize_callback' => 'tainacan_display_callback_sanitize_checkbox',
) );
$wp_customize->add_control( 'facebook_share', array(
@ -115,7 +115,7 @@ function tainacan_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'twitter_share', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'display_callback_sanitize_checkbox',
'sanitize_callback' => 'tainacan_display_callback_sanitize_checkbox',
) );
$wp_customize->add_control( 'twitter_share', array(
@ -141,7 +141,7 @@ function tainacan_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'google_share', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'display_callback_sanitize_checkbox',
'sanitize_callback' => 'tainacan_display_callback_sanitize_checkbox',
) );
$wp_customize->add_control( 'google_share', array(
@ -205,7 +205,7 @@ add_action( 'customize_register', 'tainacan_customize_register', 11 );
* Callback to Checkbox to display or no the
* Proudly Powered by Wordpress and Tainacan.
*/
function display_callback_sanitize_checkbox( $checked ) {
function tainacan_display_callback_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}

View File

@ -50,10 +50,10 @@ function tainacan_comments_callback( $comment, $args, $depth ) {
</div>
<?php }
function wrap_comment( $content ) {
function tainacan_wrap_comment( $content ) {
return '<div class="comment-text">' . $content . '</div>';
}
add_filter( 'comment_text', 'wrap_comment', 99 );
add_filter( 'comment_text', 'tainacan_wrap_comment', 99 );
/**
* Display date of post.
@ -80,12 +80,12 @@ function tainacan_meta_date_author( $echo = true ) {
}
// define the cancel_comment_reply_link callback
function filter_cancel_comment_reply_link( $formatted_link, $link, $text ) {
function tainacan_filter_cancel_comment_reply_link( $formatted_link, $link, $text ) {
// make filter magic happen here...
$formatted_link = '<a rel="nofollow" class="btn btn-info text-haiti bg-white border-oslo-gray align-self-center mt-3 ml-auto mr-1" id="cancel-comment-reply-link" href="' . $link . '" style="display:none;">' . $text . '</a>';
return $formatted_link;
}
add_filter( 'cancel_comment_reply_link', 'filter_cancel_comment_reply_link', 10, 3 );
add_filter( 'cancel_comment_reply_link', 'tainacan_filter_cancel_comment_reply_link', 10, 3 );
function tainacan_social_meta() {
global $post;
@ -130,8 +130,7 @@ function tainacan_social_meta() {
<meta property="og:image:height" content="<?php echo $image['height']; ?>"/>
<?php
} else {
<?php } else {
return;
} // End if().
}

View File

@ -8,12 +8,10 @@
<main role="main" class="mt-5 max-large margin-one-column">
<div class="row">
<div class="col-12 <?php if ( is_active_sidebar( 'sidebar-right' ) ) { ?>col-lg-9<?php } ?>">
<div class="col-12 <?php if ( is_active_sidebar( 'tainacan-sidebar-right' ) ) { ?>col-lg-9<?php } ?>">
<?php get_template_part( 'template-parts/loop' ); ?>
</div>
<?php if ( is_active_sidebar( 'sidebar-right' ) ) {
get_sidebar();
} ?>
<?php if ( is_active_sidebar( 'tainacan-sidebar-right' ) ) { get_sidebar(); } ?>
</div>
</main>
<?php get_footer();

View File

@ -1,5 +1,5 @@
<div class="col-12 col-lg-3 border-top border-jelly-bean sidebar-border">
<div id="sidebar" class="py-4 pt-md-0 mx-2 mx-sm-0 sidebar hidden-print">
<?php dynamic_sidebar( 'sidebar-right' ); ?>
<?php dynamic_sidebar( 'tainacan-sidebar-right' ); ?>
</div>
</div>