Skip to content

Commit

Permalink
chore: update php/twig to match linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
theogainey committed Sep 19, 2023
1 parent bffd644 commit b4c169d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/php/inc/custom-post-types/example-custom-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ function custom_post_type() {
'capability_type' => 'page',
);
register_post_type( 'example', $args );

}
add_action( 'init', 'custom_post_type', 0 );
1 change: 0 additions & 1 deletion src/php/inc/helpers/generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,3 @@ function get_featured_image_url( $size = 'full' ) {
$thumb_url = $thumb_url_array[0];
return $thumb_url;
}

26 changes: 13 additions & 13 deletions src/php/inc/metaboxes/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@
function example_register_meta_boxes( $meta_boxes ) {
$prefix = 'spark_example_';

$meta_boxes[] = [
$meta_boxes = array(
'title' => 'Example',
'id' => $prefix . 'metaboxes',
'post_types' => [ 'page' ], // What types of post types e.g. posts, pages, custom_post_type.
'post_types' => array( 'page' ), // What types of post types e.g. posts, pages, custom_post_type.
'context' => 'side', // Where to display on admin page. https://docs.metabox.io/creating-meta-boxes/#contexts .
'priority' => 'high',
'fields' => [
[
'fields' => array(
array(
'type' => 'checkbox',
'id' => $prefix . 'checkbox_example',
'name' => 'Checkbox',
'desc' => 'Click Yes or No!',
],
[
),
array(
'type' => 'text',
'id' => $prefix . 'text_example',
'name' => 'Text',
'desc' => 'Put Text Here',
'std' => 'Default Value',
'placeholder' => 'Try me out',
'clone' => true,
],
[
),
array(
'type' => 'image_advanced',
'id' => $prefix . 'image_example',
'name' => 'Image Advanced',
'desc' => 'Upload an Image.',
'max_file_uploads' => 1,
'max_status' => true,
],
[
),
array(
'type' => 'wysiwyg',
'id' => $prefix . 'wysiwyg_example',
'name' => 'WYSIWYG',
],
],
];
),
),
);

return $meta_boxes;
}
Expand Down
1 change: 0 additions & 1 deletion src/php/inc/taxonomies/example-custom-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ function register_custom_taxonomy() {
'show_tagcloud' => true,
);
register_taxonomy( 'example_custom_tax', array( 'example' ), $args );

}
add_action( 'init', 'register_custom_taxonomy', 0 );
1 change: 0 additions & 1 deletion src/php/inc/theme-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,5 @@ function custom_hide_editor() {
add_filter( 'use_block_editor_for_post', '__return_false' );
remove_post_type_support( 'page', 'editor' );
}

}
add_action( 'admin_init', 'custom_hide_editor' );
4 changes: 2 additions & 2 deletions src/php/views/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
{% block posts_found %}
<h1>{{ title }}</h1>
{% for post in posts %}
{% include 'partials/content-single.twig' with { post: post } %}
{% include 'partials/content-single.twig' with {post: post} %}
{% endfor %}

{% include 'partials/pagination.twig' with { pagination: posts.pagination({ show_all: false, mid_size: 3, end_size: 2 }) } %}
{% include 'partials/pagination.twig' with {pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2})} %}
{% endblock %}

{% else %}
Expand Down
4 changes: 2 additions & 2 deletions src/php/views/search.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% block posts_found %}
<h1>{{ title }}</h1>
{% for post in posts %}
{% include 'partials/content-search.twig' with { post: post} %}
{% include 'partials/content-search.twig' with {post: post} %}
{% endfor %}

{% include 'partials/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
{% include 'partials/pagination.twig' with {pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2})} %}
{% endblock %}

0 comments on commit b4c169d

Please sign in to comment.