Permalink
Browse files

Revert "Rename primer to the_primer"

  • Loading branch information...
1 parent 98921ac commit deac5afa846de5e0ff528d991a8e8a2c1a7ea5bf @jonathanbardo jonathanbardo committed on GitHub Sep 20, 2016
View
@@ -28,7 +28,7 @@
<?php endwhile; ?>
- <?php the_primer_paging_nav(); ?>
+ <?php primer_paging_nav(); ?>
<?php else : ?>
@@ -1,8 +1,59 @@
-/* global jQuery */
+/* global jQuery, primer_layouts_transport */
window.wp = window.wp || {};
( function( $ ) {
+ var api = wp.customize;
+
+ if ( typeof api !== 'undefined' ) {
+
+ filter_api_preview_transport();
+
+ }
+
+ /**
+ * Filter api transport in depending on which layout the user clicks on.
+ */
+ function filter_api_preview_transport() {
+
+ var oldApiSetting = api.Setting;
+
+ api.Setting = api.Setting.extend( {
+
+ preview: function() {
+
+ if ( 'layout' !== this.id ) {
+
+ oldApiSetting.prototype.preview.apply( this, arguments );
+
+ return;
+
+ }
+
+ var to = arguments[0],
+ from = arguments[1],
+ layouts = primer_layouts_transport,
+ transport = this.transport;
+
+ /**
+ * If we have a difference in transport strategy, refresh
+ */
+ if ( layouts[ to ] !== layouts[ from ] ) {
+
+ this.transport = 'refresh';
+
+ }
+
+ oldApiSetting.prototype.preview.apply( this, arguments );
+
+ this.transport = transport;
+
+ }
+
+ } );
+
+ }
+
$( document ).ready( function() {
$( 'input[name="primer-layout-override"]' ).change( function() {
@@ -1 +1 @@
-window.wp=window.wp||{},function(a){a(document).ready(function(){a('input[name="primer-layout-override"]').change(function(){return"1"===a(this).val()?void a(".primer-layout ul li").removeClass("disabled").addClass("active").find("input").prop("disabled",!1):(a(".primer-layout ul li").addClass("disabled").find(":not(.global)").removeClass("active").addClass("disabled").find("input").prop("disabled",!0),void a(".primer-layout ul li.global input").prop("checked",!0))})})}(jQuery);
+window.wp=window.wp||{},function(a){function b(){var a=c.Setting;c.Setting=c.Setting.extend({preview:function(){if("layout"!==this.id)return void a.prototype.preview.apply(this,arguments);var b=arguments[0],c=arguments[1],d=primer_layouts_transport,e=this.transport;d[b]!==d[c]&&(this.transport="refresh"),a.prototype.preview.apply(this,arguments),this.transport=e}})}var c=wp.customize;"undefined"!=typeof c&&b(),a(document).ready(function(){a('input[name="primer-layout-override"]').change(function(){return"1"===a(this).val()?void a(".primer-layout ul li").removeClass("disabled").addClass("active").find("input").prop("disabled",!1):(a(".primer-layout ul li").addClass("disabled").find(":not(.global)").removeClass("active").addClass("disabled").find("input").prop("disabled",!0),void a(".primer-layout ul li.global input").prop("checked",!0))})})}(jQuery);
View
@@ -11,7 +11,7 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php if ( ! the_primer_use_featured_hero_image() ) : ?>
+ <?php if ( ! primer_use_featured_hero_image() ) : ?>
<?php get_template_part( 'templates/parts/loop/post', 'thumbnail' ); ?>
View
@@ -15,14 +15,14 @@
/**
* Fires inside the `article` element, before the content.
*
- * @hooked the_primer_woo_shop_messages - 10
+ * @hooked primer_woo_shop_messages - 10
*
* @since 1.0.0
*/
- do_action( 'the_primer_before_post_content' );
+ do_action( 'primer_before_post_content' );
?>
- <?php if ( ! is_single() || ! the_primer_use_featured_hero_image() ) : ?>
+ <?php if ( ! is_single() || ! primer_use_featured_hero_image() ) : ?>
<?php get_template_part( 'templates/parts/loop/post', 'thumbnail' ); ?>
@@ -36,7 +36,7 @@
*
* @since 1.0.0
*/
- do_action( 'the_primer_after_post_title_template' );
+ do_action( 'primer_after_post_title_template' );
?>
<?php if ( is_single() ) : ?>
@@ -57,7 +57,7 @@
*
* @since 1.0.0
*/
- do_action( 'the_primer_after_post_content' );
+ do_action( 'primer_after_post_content' );
?>
</article><!-- #post-## -->
View
@@ -19,7 +19,7 @@
*
* @since 1.0.0
*/
- do_action( 'the_primer_before_footer' );
+ do_action( 'primer_before_footer' );
?>
<footer id="colophon" class="site-footer">
@@ -32,7 +32,7 @@
*
* @since 1.0.0
*/
- do_action( 'the_primer_footer' );
+ do_action( 'primer_footer' );
?>
</div><!-- .site-footer-inner -->
@@ -45,7 +45,7 @@
*
* @since 1.0.0
*/
- do_action( 'the_primer_after_footer' );
+ do_action( 'primer_after_footer' );
?>
</div><!-- #page -->
Oops, something went wrong.

0 comments on commit deac5af

Please sign in to comment.