Skip to content

Commit

Permalink
Merge pull request #107 from Automattic/feature/add-rector
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones authored Aug 14, 2024
2 parents 9f27115 + 32e2d8d commit d5f46c6
Show file tree
Hide file tree
Showing 57 changed files with 2,154 additions and 1,805 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^9",
"wp-coding-standards/wpcs": "^3",
"yoast/phpunit-polyfills": "^1"
"yoast/phpunit-polyfills": "^1",
"rector/rector": "^1.2"
},
"scripts": {
"cbf": [
Expand Down
8 changes: 6 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function z_get_zoninator() {

/**
* Get a list of all zones
*
* @return array List of all zones
*/
function z_get_zones() {
Expand Down Expand Up @@ -68,10 +69,13 @@ function z_get_post_zones( $post_id = 0 ) {
}

function z_get_loop_post_id_or_default( $post_id = 0 ) {
if( ! $post_id ) {
if ( ! $post_id ) {
global $post;
if( $post && isset( $post->ID ) ) $post_id = $post->ID;
if ( $post && isset( $post->ID ) ) {
$post_id = $post->ID;
}
}

return $post_id;
}

Expand Down
Loading

0 comments on commit d5f46c6

Please sign in to comment.