Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions acf-json/group_60978d51e5bff.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,48 @@
"ajax": 0,
"placeholder": ""
},
{
"key": "field_65b6292d3f5f5",
"label": "Select Testimonials",
"name": "select_testimonials",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"testimonial"
],
"post_status": "",
"taxonomy": "",
"return_format": "object",
"multiple": 1,
"allow_null": 0,
"bidirectional": 0,
"ui": 1,
"bidirectional_target": []
},
{
"key": "field_60978d67b0fad",
"label": "Testimonials",
"name": "testimonials",
"aria-label": "",
"type": "repeater",
"instructions": "",
"instructions": "Enter testimonials manually.",
"required": 0,
"conditional_logic": 0,
"conditional_logic": [
[
{
"field": "field_65b6292d3f5f5",
"operator": "==empty"
}
]
],
"wrapper": {
"width": "",
"class": "",
Expand Down Expand Up @@ -182,5 +215,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1703691375
}
"modified": 1706438164
}
4 changes: 2 additions & 2 deletions acf-json/post_type_6582a58f15348.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"view_item": "View Work",
"view_items": "View Works",
"add_new_item": "Add New Work",
"add_new": "",
"add_new": "Add New Work",
"new_item": "New Work",
"parent_item_colon": "Parent Work:",
"search_items": "Search Works",
Expand Down Expand Up @@ -84,4 +84,4 @@
"delete_with_user": false,
"register_meta_box_cb": "",
"modified": 1703061615
}
}
15 changes: 8 additions & 7 deletions acf-json/post_type_6582a8cf72f35.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
"view_item": "View Testimonial",
"view_items": "View Testimonial",
"add_new_item": "Add New Testimonial",
"add_new": "",
"add_new": "Add New Testimonial",
"new_item": "New Testimonial",
"parent_item_colon": "Parent Testimonial:",
"search_items": "Search Testimonial",
"not_found": "No testimonial found",
"not_found_in_trash": "No testimonial found in Trash",
"archives": "Testimonial Archives",
"attributes": "Testimonial Attributes",
"featured_image": "Avatar",
"set_featured_image": "Set avatar",
"remove_featured_image": "Remove avatar",
"use_featured_image": "Use avatar",
"featured_image": "Testimonial image",
"set_featured_image": "Set testimonial image",
"remove_featured_image": "Remove testimonial image",
"use_featured_image": "Use testimonial image",
"insert_into_item": "Insert into testimonial",
"uploaded_to_this_item": "Uploaded to this testimonial",
"filter_items_list": "Filter testimonial list",
Expand Down Expand Up @@ -80,5 +80,6 @@
"can_export": true,
"delete_with_user": false,
"register_meta_box_cb": "",
"modified": 1703062019
}
"enter_title_here": "First and last name",
"modified": 1706433207
}
6 changes: 3 additions & 3 deletions acf-json/taxonomy_65833605916a9.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"publicly_queryable": 1,
"hierarchical": 1,
"show_ui": 1,
"show_in_menu": 1,
"show_in_menu": 0,
"show_in_nav_menus": 1,
"show_in_rest": 1,
"rest_base": "",
Expand All @@ -73,5 +73,5 @@
"meta_box": "default",
"meta_box_cb": "",
"meta_box_sanitize_cb": "",
"modified": 1703240275
}
"modified": 1706442054
}
Binary file added assets/images/database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/robot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions blocks/testimonial/testimonial.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@
$wds_classes[] = 'align' . $block['align'];
}

$wd_s_testimonials = get_field( 'testimonials' );
$wd_s_block_style = get_field( 'style' ) ? get_field( 'style' ) : 'simple';
$wd_s_block_id = 'tslider' . wp_rand( 1, 100 );
$wd_s_select_testimonials = get_field( 'select_testimonials' );

if ( $wd_s_select_testimonials ) {
foreach ( $wd_s_select_testimonials as $wd_s_key => $wd_s_select_testimonial ) {
$wd_s_testimonials[ $wd_s_key ]['author'] = $wd_s_select_testimonial->post_title;
$wd_s_testimonials[ $wd_s_key ]['content'] = $wd_s_select_testimonial->post_content;
$wd_s_testimonials[ $wd_s_key ]['avatar'] = get_the_post_thumbnail_url( $wd_s_select_testimonial->ID );
$wd_s_testimonials[ $wd_s_key ]['rating'] = get_field( 'rating', $wd_s_select_testimonial->ID ) ? get_field( 'rating', $wd_s_select_testimonial->ID ) : 0;
$wd_s_testimonials[ $wd_s_key ]['job_title'] = get_field( 'position', $wd_s_select_testimonial->ID ) ? get_field( 'position', $wd_s_select_testimonial->ID ) : '';
}
} else {
$wd_s_testimonials = get_field( 'testimonials' );
}

$wd_s_block_style = get_field( 'style' ) ? get_field( 'style' ) : 'simple';
$wd_s_block_id = 'tslider' . wp_rand( 1, 100 );

if ( get_query_var( 'testimonials' ) ) {
$wd_s_testimonials = get_query_var( 'testimonials' );
Expand Down Expand Up @@ -61,7 +74,7 @@
echo '</div>';
}
?>
<p><?php echo esc_html( $wd_s_testimonial['content'] ); ?></p>
<p><?php echo esc_html( wp_strip_all_tags( $wd_s_testimonial['content'] ) ); ?></p>
</div>
<div class="t-meta">
<?php if ( $wd_s_testimonial['avatar'] ) : ?>
Expand Down
23 changes: 23 additions & 0 deletions inc/hooks/disable-gutenberg-cpts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* Disable Gutenberg editor on cpts.
*
* @package wd_s
*/

namespace WebDevStudios\wd_s;

/**
* Disable_gutenberg_cpts
*
* @param bool $is_enabled flag to enable.
* @param string $post_type the post type.
*/
function disable_gutenberg_cpts( $is_enabled, $post_type ) {
if ( 'testimonial' === $post_type ) {
return false;
}
return $is_enabled;
}

add_filter( 'use_block_editor_for_post_type', __NAMESPACE__ . '\disable_gutenberg_cpts', 10, 2 );
30 changes: 30 additions & 0 deletions inc/hooks/services-taxonomy-menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Update admin menu item for service taxonomi.
*
* @package wd_s
*/

namespace WebDevStudios\wd_s;

/**
* Add services taxonomy as parent menu.
*/
function move_services_taxonomy_menu() {
add_menu_page( esc_html( 'Services' ), esc_html( 'Services' ), 'manage_options', 'edit-tags.php?taxonomy=service', '', 'dashicons-category', 5 );
}
add_action( 'admin_menu', __NAMESPACE__ . '\move_services_taxonomy_menu' );

/**
* Highlight services taxonomy menu.
*
* @param string $parent_file set as main parent.
*/
function highlight_taxonomy_parent_menu( $parent_file ) {
if ( 'service' === get_current_screen()->taxonomy ) {
$parent_file = 'edit-tags.php?taxonomy=service';
}

return $parent_file;
}
add_action( 'parent_file', __NAMESPACE__ . '\highlight_taxonomy_parent_menu' );