Skip to content

Commit

Permalink
Merge pull request #24 from Codeinwp/add/string-filters
Browse files Browse the repository at this point in the history
chore: add filters to strings
  • Loading branch information
HardeepAsrani authored Feb 3, 2024
2 parents 5d00669 + a74d1bd commit 2c14c45
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 80 deletions.
4 changes: 0 additions & 4 deletions patterns/call-to-action-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
*/

$quickwp_strings = apply_filters( 'quickwp_strings', array() );

$images = array(
// Add image paths here as needed
);
?>

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70","left":"var:preset|spacing|40","right":"var:preset|spacing|40"},"margin":{"top":"0","bottom":"0"},"blockGap":"var:preset|spacing|50"},"elements":{"link":{"color":{"text":"var:preset|color|contrast-4"}}}},"backgroundColor":"accent","textColor":"contrast-4","layout":{"type":"constrained"}} -->
Expand Down
6 changes: 3 additions & 3 deletions patterns/call-to-action-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading {"textAlign":"left","fontSize":"x-large"} -->
<h2 class="wp-block-heading has-text-align-left has-x-large-font-size"><?php echo esc_html( $quickwp_strings['cta_title'] ); ?></h2>
<h2 class="wp-block-heading has-text-align-left has-x-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/call-to-action-2/title', $quickwp_strings['cta_title'] ) ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"left"} -->
<p class="has-text-align-left"><?php echo esc_html( $quickwp_strings['section_description'] ); ?></p>
<p class="has-text-align-left"><?php echo esc_html( apply_filters( 'quickwp/call-to-action-2/subtitle', $quickwp_strings['section_description'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
Expand All @@ -28,7 +28,7 @@
<div class="wp-block-buttons">
<!-- wp:button {"backgroundColor":"accent","style":{"spacing":{"padding":{"left":"var:preset|spacing|60","right":"var:preset|spacing|60","top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"className":"is-style-fill","fontSize":"large"} -->
<div class="wp-block-button has-custom-font-size is-style-fill has-large-font-size">
<a class="wp-block-button__link has-accent-background-color has-background wp-element-button" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--60)"><?php echo esc_html( $quickwp_strings['button_text_2'] ); ?></a>
<a class="wp-block-button__link has-accent-background-color has-background wp-element-button" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--60)"><?php echo esc_html( apply_filters( 'quickwp/call-to-action-2/button', $quickwp_strings['button_text_2'] ) ); ?></a>
</div>
<!-- /wp:button -->
</div>
Expand Down
6 changes: 3 additions & 3 deletions patterns/content-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70","left":"var:preset|spacing|40","right":"var:preset|spacing|40"},"blockGap":"var:preset|spacing|50","margin":{"top":"0","bottom":"0"}}},"backgroundColor":"base-2","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-base-2-background-color has-background" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--70);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--70);padding-left:var(--wp--preset--spacing--40)">
<!-- wp:paragraph {"fontSize":"large"} -->
<p class="has-large-font-size"><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p class="has-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/content-4/paragraph-1', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:columns -->
<div class="wp-block-columns">
<!-- wp:column {"width":"100%"} -->
<div class="wp-block-column" style="flex-basis:100%">
<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/content-4/paragraph-2', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":"100%"} -->
<div class="wp-block-column" style="flex-basis:100%">
<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/content-4/paragraph-3', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->
Expand Down
16 changes: 8 additions & 8 deletions patterns/content-on-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$quickwp_strings = apply_filters( 'quickwp_strings', array() );

$images = array(
QUICKWP_URL . 'assets/images/qwp-img-09.webp',
apply_filters( 'quickwp/content-on-background/image', QUICKWP_URL . 'assets/images/qwp-img-09.webp' ),
);
?>

Expand All @@ -19,19 +19,19 @@
<!-- wp:column {"width":"40%"} -->
<div class="wp-block-column" style="flex-basis:40%">
<!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"600","letterSpacing":"2px"}},"fontSize":"small"} -->
<p class="has-small-font-size" style="font-style:normal;font-weight:600;letter-spacing:2px;text-transform:uppercase">Overview</p>
<p class="has-small-font-size" style="font-style:normal;font-weight:600;letter-spacing:2px;text-transform:uppercase"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/subtitle', $quickwp_strings['content_subtitle'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":"60%"} -->
<div class="wp-block-column" style="flex-basis:60%">
<!-- wp:heading -->
<h2 class="wp-block-heading">A content section</h2>
<h2 class="wp-block-heading"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/title', $quickwp_strings['content_title'] ) ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"fontSize":"large"} -->
<p class="has-large-font-size"><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p class="has-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/paragraph-1', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->
Expand All @@ -47,26 +47,26 @@
<!-- wp:column {"width":"40%"} -->
<div class="wp-block-column" style="flex-basis:40%">
<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/content-on-background/paragraph-2', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":"60%"} -->
<div class="wp-block-column" style="flex-basis:60%">
<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">A content section</h3>
<h3 class="wp-block-heading"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/heading', $quickwp_strings['section_title'] ) ); ?></h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"fontSize":"large"} -->
<p class="has-large-font-size"><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p class="has-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/paragraph-3', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline">
<a class="wp-block-button__link wp-element-button"><?php echo esc_html( $quickwp_strings['button_text_2'] ); ?></a>
<a class="wp-block-button__link wp-element-button"><?php echo esc_html( apply_filters( 'quickwp/content-on-background/button', $quickwp_strings['button_text_2'] ) ); ?></a>
</div>
<!-- /wp:button -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion patterns/content-plain.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70","left":"var:preset|spacing|40","right":"var:preset|spacing|40"},"blockGap":"var:preset|spacing|30","margin":{"top":"0","bottom":"0"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--70);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--70);padding-left:var(--wp--preset--spacing--40)">
<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/content-plain/text', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
8 changes: 4 additions & 4 deletions patterns/content-with-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$quickwp_strings = apply_filters( 'quickwp_strings', array() );

$images = array(
QUICKWP_URL . 'assets/images/qwp-img-02.webp',
apply_filters( 'quickwp/content-with-image/image', QUICKWP_URL . 'assets/images/qwp-img-02.webp' ),
);
?>

Expand All @@ -29,17 +29,17 @@
<!-- wp:column {"verticalAlignment":"center","width":"40%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:40%">
<!-- wp:heading -->
<h2 class="wp-block-heading"><?php echo esc_html( $quickwp_strings['section_title'] ); ?></h2>
<h2 class="wp-block-heading"><?php echo esc_html( apply_filters( 'quickwp/content-with-image/title', $quickwp_strings['section_title'] ) ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/content-with-image/content', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( $quickwp_strings['button_text_2'] ); ?></a></div>
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( apply_filters( 'quickwp/content-with-image/button', $quickwp_strings['button_text_2'] ) ); ?></a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
Expand Down
16 changes: 8 additions & 8 deletions patterns/feature-columns-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$quickwp_strings = apply_filters( 'quickwp_strings', array() );

$images = array(
QUICKWP_URL . 'assets/images/qwp-img-08.webp',
QUICKWP_URL . 'assets/images/qwp-img-06.webp',
apply_filters( 'quickwp/feature-columns-2/item-1/image', QUICKWP_URL . 'assets/images/qwp-img-08.webp' ),
apply_filters( 'quickwp/feature-columns-2/item-2/image', QUICKWP_URL . 'assets/images/qwp-img-06.webp' ),
);
?>

Expand All @@ -23,16 +23,16 @@

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:heading {"fontSize":"large"} -->
<h2 class="wp-block-heading has-large-font-size"><?php echo esc_html( $quickwp_strings['content_title'] ); ?></h2>
<h2 class="wp-block-heading has-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-1/title', $quickwp_strings['content_title'] ) ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-1/description', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( $quickwp_strings['button_text_2'] ); ?></a></div>
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-1/button', $quickwp_strings['button_text_2'] ) ); ?></a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div>
Expand All @@ -45,16 +45,16 @@

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:heading {"fontSize":"large"} -->
<h2 class="wp-block-heading has-large-font-size"><?php echo esc_html( $quickwp_strings['content_title'] ); ?></h2>
<h2 class="wp-block-heading has-large-font-size"><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-2/title', $quickwp_strings['content_title'] ) ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $quickwp_strings['paragraph_text'] ); ?></p>
<p><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-2/description', $quickwp_strings['paragraph_text'] ) ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( $quickwp_strings['button_text_2'] ); ?></a></div>
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"><?php echo esc_html( apply_filters( 'quickwp/feature-columns-2/item-2/button', $quickwp_strings['button_text_2'] ) ); ?></a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div>
Expand Down
Loading

0 comments on commit 2c14c45

Please sign in to comment.