Skip to content

Commit

Permalink
Merged development branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryA committed Oct 12, 2016
2 parents ccda99b + 491658c commit 6308409
Show file tree
Hide file tree
Showing 182 changed files with 3,094 additions and 2,348 deletions.
2 changes: 1 addition & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
* @link http://www.getbeans.io
*/

beans_load_document();
beans_load_document();
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ If you are a Beans superstar and you want to contribute to Beans core, here are
* Commits must be split into specific tasks and kept small so that other developers can easily see what it's about.
* Code format must be strictly similar to the rest of the theme framework.

Thanks for making Beans such a great theme which is loved and used by truly passionate people.
Thanks for making Beans such a great theme which is loved and used by truly passionate people.
2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
*/

// Template situated in /lib/templates/structure/comments.php
beans_load_default_template( __FILE__ );
beans_load_default_template( __FILE__ );
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
*/

// Template situated in /lib/templates/structure/footer.php
beans_load_default_template( __FILE__ );
beans_load_default_template( __FILE__ );
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* @link http://www.getbeans.io
*/

require_once( dirname( __FILE__ ) . '/lib/init.php' );
require_once( dirname( __FILE__ ) . '/lib/init.php' );
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
*/

// Template situated in /lib/templates/structure/header.php
beans_load_default_template( __FILE__ );
beans_load_default_template( __FILE__ );
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
* @link http://www.getbeans.io
*/

beans_load_document();
beans_load_document();
12 changes: 7 additions & 5 deletions lib/admin/assets/js/wp-customize-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@

viewportWidth: function() {

if ( wp.customize.value( 'beans_enable_viewport_width' )() == true )
if ( true == wp.customize.value( 'beans_enable_viewport_width' )() ) {
this.wpIframe.css( 'width', wp.customize.value( 'beans_viewport_width' )() );
else
} else {
this.wpIframe.css( 'width', '100%' );
}

},
viewportHeight: function() {

if ( wp.customize.value( 'beans_enable_viewport_height' )() == true )
if ( true == wp.customize.value( 'beans_enable_viewport_height' )() ) {
this.wpIframe.css( 'height', wp.customize.value( 'beans_viewport_height' )() );
else
} else {
this.wpIframe.css( 'height', '100%' );
}

},
init: function() {
Expand Down Expand Up @@ -79,4 +81,4 @@

});

})( window.jQuery );
})( window.jQuery );
31 changes: 15 additions & 16 deletions lib/admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

beans_add_smart_action( 'admin_init', 'beans_do_register_term_meta' );

/**
* Add Beans term meta.
*
Expand All @@ -18,26 +17,25 @@ function beans_do_register_term_meta() {
$options = beans_get_layouts_for_options();

// Stop here if there is less than two layouts options.
if ( count( $options ) < 2 )
if ( count( $options ) < 2 ) {
return;
}

$fields = array(
array(
'id' => 'beans_layout',
'label' => _x( 'Layout', 'term meta', 'tm-beans' ),
'type' => 'radio',
'id' => 'beans_layout',
'label' => _x( 'Layout', 'term meta', 'tm-beans' ),
'type' => 'radio',
'default' => 'default_fallback',
'options' => beans_get_layouts_for_options( true )
)
'options' => beans_get_layouts_for_options( true ),
),
);

beans_register_term_meta( $fields, array( 'category', 'post_tag' ), 'tm-beans' );

}


beans_add_smart_action( 'admin_init', 'beans_do_register_post_meta' );

/**
* Add Beans post meta.
*
Expand All @@ -49,19 +47,20 @@ function beans_do_register_post_meta() {
$options = beans_get_layouts_for_options();

// Stop here if there is less than two layouts options.
if ( count( $options ) < 2 )
if ( count( $options ) < 2 ) {
return;
}

$fields = array(
array(
'id' => 'beans_layout',
'label' => _x( 'Layout', 'post meta', 'tm-beans' ),
'type' => 'radio',
'id' => 'beans_layout',
'label' => _x( 'Layout', 'post meta', 'tm-beans' ),
'type' => 'radio',
'default' => 'default_fallback',
'options' => beans_get_layouts_for_options( true )
)
'options' => beans_get_layouts_for_options( true ),
),
);

beans_register_post_meta( $fields, array( 'post', 'page' ), 'tm-beans', array( 'title' => __( 'Post Options', 'tm-beans' ) ) );

}
}
25 changes: 12 additions & 13 deletions lib/admin/updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

add_filter( 'site_transient_update_themes', 'beans_updater' );

/**
* Retrieve product data from Beans REST API.
*
Expand All @@ -18,14 +17,16 @@
function beans_updater( $value ) {

// Stop here if the current user is not a super admin user.
if ( !is_super_admin() )
if ( ! is_super_admin() ) {
return;
}

$data = get_site_transient( 'beans_updater' );
$theme = wp_get_theme( 'tm-beans' );

if ( !$theme->exists() )
if ( ! $theme->exists() ) {
return $value;
}

$current_version = $theme->get( 'Version' );

Expand Down Expand Up @@ -54,14 +55,14 @@ function beans_updater( $value ) {
// Return data if Beans is not up to date.
if ( version_compare( $current_version, beans_get( 'version', $data ), '<' ) ) {

$value->response[$data['path']] = array(
'slug' => $data['slug'],
'name' => $data['name'],
'url' => $data['changelog_url'],
'package' => $data['download_url'],
$value->response[ $data['path'] ] = array(
'slug' => $data['slug'],
'name' => $data['name'],
'url' => $data['changelog_url'],
'package' => $data['download_url'],
'new_version' => $data['version'],
'tested' => $data['tested'],
'requires' => $data['requires']
'tested' => $data['tested'],
'requires' => $data['requires'],
);

return $value;
Expand All @@ -72,9 +73,7 @@ function beans_updater( $value ) {

}


add_action( 'load-update-core.php', 'beans_updater_clear_transient' );

/**
* Clear updater transient.
*
Expand All @@ -84,4 +83,4 @@ function beans_updater_clear_transient() {

delete_site_transient( 'beans_updater' );

}
}
81 changes: 38 additions & 43 deletions lib/admin/wp-customize.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

beans_add_smart_action( 'customize_preview_init', 'beans_do_enqueue_wp_customize_assets' );

/**
* Enqueue Beans assets for the WordPress Customizer.
*
Expand All @@ -18,9 +17,7 @@ function beans_do_enqueue_wp_customize_assets() {

}


beans_add_smart_action( 'customize_register', 'beans_do_register_wp_customize_options' );

/**
* Add Beans options to the WordPress Customizer.
*
Expand All @@ -30,11 +27,10 @@ function beans_do_register_wp_customize_options() {

$fields = array(
array(
'id' => 'beans_logo_image',
'label' => __( 'Logo Image', 'tm-beans' ),
'type' => 'WP_Customize_Image_Control',
'transport' => 'refresh'
)
'id' => 'beans_logo_image',
'label' => __( 'Logo Image', 'tm-beans' ),
'type' => 'WP_Customize_Image_Control',
),
);

beans_register_wp_customize_options( $fields, 'title_tagline', array( 'title' => __( 'Branding', 'tm-beans' ) ) );
Expand All @@ -47,13 +43,12 @@ function beans_do_register_wp_customize_options() {

$fields = array(
array(
'id' => 'beans_layout',
'label' => __( 'Default Layout', 'tm-beans' ),
'type' => 'radio',
'default' => beans_get_default_layout(),
'options' => $options,
'transport' => 'refresh'
)
'id' => 'beans_layout',
'label' => __( 'Default Layout', 'tm-beans' ),
'type' => 'radio',
'default' => beans_get_default_layout(),
'options' => $options,
),
);

beans_register_wp_customize_options( $fields, 'beans_layout', array( 'title' => __( 'Default Layout', 'tm-beans' ), 'priority' => 1000 ) );
Expand All @@ -62,49 +57,49 @@ function beans_do_register_wp_customize_options() {

$fields = array(
array(
'id' => 'beans_viewport_width_group',
'label' => __( 'Viewport Width', 'tm-beans' ),
'type' => 'group',
'id' => 'beans_viewport_width_group',
'label' => __( 'Viewport Width', 'tm-beans' ),
'type' => 'group',
'fields' => array(
array(
'id' => 'beans_enable_viewport_width',
'type' => 'activation',
'default' => false
'id' => 'beans_enable_viewport_width',
'type' => 'activation',
'default' => false,
),
array(
'id' => 'beans_viewport_width',
'type' => 'slider',
'default' => 1000,
'min' => 300,
'max' => 2500,
'id' => 'beans_viewport_width',
'type' => 'slider',
'default' => 1000,
'min' => 300,
'max' => 2500,
'interval' => 10,
'unit' => 'px'
'unit' => 'px',
),
)
),
),
array(
'id' => 'beans_viewport_height_group',
'label' => __( 'Viewport Height', 'tm-beans' ),
'type' => 'group',
'id' => 'beans_viewport_height_group',
'label' => __( 'Viewport Height', 'tm-beans' ),
'type' => 'group',
'fields' => array(
array(
'id' => 'beans_enable_viewport_height',
'type' => 'activation',
'default' => false
'id' => 'beans_enable_viewport_height',
'type' => 'activation',
'default' => false,
),
array(
'id' => 'beans_viewport_height',
'type' => 'slider',
'default' => 1000,
'min' => 300,
'max' => 2500,
'id' => 'beans_viewport_height',
'type' => 'slider',
'default' => 1000,
'min' => 300,
'max' => 2500,
'interval' => 10,
'unit' => 'px'
'unit' => 'px',
),
)
)
),
),
);

beans_register_wp_customize_options( $fields, 'beans_preview', array( 'title' => __( 'Preview Tools', 'tm-beans' ), 'priority' => 1010 ) );

}
}
4 changes: 1 addition & 3 deletions lib/api/actions/class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function __construct( $hook, $callback, $priority, $args ) {

}


/**
* Get action content and set it as the callback.
*/
Expand All @@ -47,5 +46,4 @@ public function callback() {
echo call_user_func_array( $this->callback[0], $this->callback[1] );

}

}
}
Loading

0 comments on commit 6308409

Please sign in to comment.