Skip to content

Commit

Permalink
phpcs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtashjian committed Sep 3, 2020
1 parent 50613ff commit 8afd924
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion includes/class-coblocks-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ public function enable_html_email() {
*/
public function success_message( $atts ) {

$sent_notice = ( isset( $atts['successText'] ) && ! empty( $atts['successText'] ) ) ? $atts['successText'] : $this->default_success_text();
$sent_notice = ( isset( $atts['successText'] ) && ! empty( $atts['successText'] ) ) ? $atts['successText'] : $this->default_success_text();

/**
* Filter the success message after a form submission
Expand Down
10 changes: 4 additions & 6 deletions src/blocks/post-carousel/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,6 @@ function coblocks_register_post_carousel_block() {
}
add_action( 'init', 'coblocks_register_post_carousel_block' );



/**
* Handles outdated versions of the `coblocks/post-carousel` block by converting
* attribute `categories` from a numeric string to an array with key `id`.
Expand All @@ -353,14 +351,13 @@ function coblocks_register_post_carousel_block() {
* block is dynamic, the usual provisions for block migration are insufficient,
* as they only act when a block is loaded in the editor.
*
* TODO: Remove when and if the bottom client-side deprecation for this block
* is removed.
* Remove when and if the bottom client-side deprecation for this block is removed.
*
* @param array $block A single parsed block object.
*
* @return array The migrated block object.
*/
function block_coblocks_post_carousel_migrate_categories( $block ) {
function coblocks_post_carousel_migrate_categories( $block ) {
if (
'coblocks/post-carousel' === $block['blockName'] &&
! empty( $block['attrs']['categories'] ) &&
Expand All @@ -372,4 +369,5 @@ function block_coblocks_post_carousel_migrate_categories( $block ) {
}
return $block;
}
add_filter( 'render_block_data', 'block_coblocks_post_carousel_migrate_categories' );

add_filter( 'render_block_data', 'coblocks_post_carousel_migrate_categories' );
11 changes: 5 additions & 6 deletions src/blocks/posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ function coblocks_posts( $posts, $attributes ) {
$block_content = sprintf(
'<div class="%1$s"><div class="%2$s" style="%3$s">',
esc_attr( implode( ' ', $class_name ) ),
esc_attr( implode( ' ', apply_filters( 'coblocks/render/wrapper/class', $class, $attributes ) ) ),
esc_attr( implode( ' ', apply_filters( 'coblocks/render/wrapper/styles', $styles, $attributes ) ) )
esc_attr( implode( ' ', apply_filters( 'coblocks_render_wrapper_class', $class, $attributes ) ) ),
esc_attr( implode( ' ', apply_filters( 'coblocks_render_wrapper_styles', $styles, $attributes ) ) )
);

$list_items_markup = '';
Expand Down Expand Up @@ -337,14 +337,13 @@ function coblocks_register_posts_block() {
* block is dynamic, the usual provisions for block migration are insufficient,
* as they only act when a block is loaded in the editor.
*
* TODO: Remove when and if the bottom client-side deprecation for this block
* is removed.
* Remove when and if the bottom client-side deprecation for this block is removed.
*
* @param array $block A single parsed block object.
*
* @return array The migrated block object.
*/
function block_coblocks_posts_migrate_categories( $block ) {
function coblocks_posts_migrate_categories( $block ) {
if (
'coblocks/posts' === $block['blockName'] &&
! empty( $block['attrs']['categories'] ) &&
Expand All @@ -356,4 +355,4 @@ function block_coblocks_posts_migrate_categories( $block ) {
}
return $block;
}
add_filter( 'render_block_data', 'block_coblocks_posts_migrate_categories' );
add_filter( 'render_block_data', 'coblocks_posts_migrate_categories' );
17 changes: 11 additions & 6 deletions src/components/gutter-control/gutter-wrapper.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?php
/**
* Add inline attributes to blocks rendered with gutters.
*
* @package CoBlocks
*/

/**
* Add gutter styles in php
*
* @param $styles { array } array of styles
* @param $attributes { array } block attributes
* @param array $styles array of styles.
* @param array $attributes block attributes.
*
* @return array
*/
Expand All @@ -16,14 +21,14 @@ function coblocks_add_gutter_styles( $styles, $attributes ) {
return $styles;
}

add_filter( 'coblocks/render/wrapper/styles', 'coblocks_add_gutter_styles', 10, 2 );
add_filter( 'coblocks_render_wrapper_styles', 'coblocks_add_gutter_styles', 10, 2 );


/**
* Add gutter class in php
*
* @param $classes { array } array of classes
* @param $attributes { array } block attributes
* @param array $classes array of classes.
* @param array $attributes block attributes.
*
* @return array
*/
Expand All @@ -34,4 +39,4 @@ function coblocks_add_gutter_class( $classes, $attributes ) {

return $classes;
}
add_filter( 'coblocks/render/wrapper/class', 'coblocks_add_gutter_class', 10, 2 );
add_filter( 'coblocks_render_wrapper_class', 'coblocks_add_gutter_class', 10, 2 );

0 comments on commit 8afd924

Please sign in to comment.