From 8f1a89c61d54d952edd22308e97428834b3dffe8 Mon Sep 17 00:00:00 2001 From: Ariel Jolo Date: Fri, 10 Jan 2025 16:20:55 -0300 Subject: [PATCH 1/9] CF7 to ACF Supporters --- themes/osi/functions.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/themes/osi/functions.php b/themes/osi/functions.php index 9e9b947..d8853da 100755 --- a/themes/osi/functions.php +++ b/themes/osi/functions.php @@ -425,3 +425,28 @@ function osi_wpdc_comment_body( string $comment_body ) { return $trimmed_comment_body; } add_filter( 'wpdc_comment_body', 'osi_wpdc_comment_body', 10, 1 ); + +/** + * + * Create a new Supporter in ACF, based on a Contact Forms 7 submission. + * + */ +add_action('wpcf7_before_send_mail', 'save_form_data_to_cpt'); +function save_form_data_to_cpt($contact_form) { + $submission = WPCF7_Submission::get_instance(); + if ($submission) { + $data = $submission->get_posted_data(); + + $post_id = wp_insert_post(array( + 'post_title' => $data['your-name'], + 'post_type' => 'supporter', + 'post_status' => 'pending' + )); + update_field('name', $data['your-name'], $post_id); + update_field('organization', $data['your-org'], $post_id); + update_field('endorsement_type', $data['your-endorsement'], $post_id); + update_field('quote', $data['your-message'], $post_id); + } else { + error_log('WPCF7_Submission instance is null.'); + } +} \ No newline at end of file From e096728d71d62ab6448a82e1a0668491ededaf75 Mon Sep 17 00:00:00 2001 From: Ariel Jolo Date: Fri, 10 Jan 2025 23:31:46 -0300 Subject: [PATCH 2/9] Changinf spaces for tabs --- themes/osi/functions.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/themes/osi/functions.php b/themes/osi/functions.php index d8853da..d47d274 100755 --- a/themes/osi/functions.php +++ b/themes/osi/functions.php @@ -433,20 +433,20 @@ function osi_wpdc_comment_body( string $comment_body ) { */ add_action('wpcf7_before_send_mail', 'save_form_data_to_cpt'); function save_form_data_to_cpt($contact_form) { - $submission = WPCF7_Submission::get_instance(); - if ($submission) { - $data = $submission->get_posted_data(); - - $post_id = wp_insert_post(array( - 'post_title' => $data['your-name'], - 'post_type' => 'supporter', - 'post_status' => 'pending' - )); - update_field('name', $data['your-name'], $post_id); + $submission = WPCF7_Submission::get_instance(); + if ($submission) { + $data = $submission->get_posted_data(); + + $post_id = wp_insert_post(array( + 'post_title' => $data['your-name'], + 'post_type' => 'supporter', + 'post_status' => 'pending' + )); + update_field('name', $data['your-name'], $post_id); update_field('organization', $data['your-org'], $post_id); update_field('endorsement_type', $data['your-endorsement'], $post_id); update_field('quote', $data['your-message'], $post_id); - } else { + } else { error_log('WPCF7_Submission instance is null.'); } } \ No newline at end of file From de1656629cb00aaa3d990a2826ccfa8a7ccbc902 Mon Sep 17 00:00:00 2001 From: Ariel Jolo Date: Fri, 10 Jan 2025 23:47:41 -0300 Subject: [PATCH 3/9] Clean up --- themes/osi/functions.php | 51 ++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/themes/osi/functions.php b/themes/osi/functions.php index d47d274..d0121d4 100755 --- a/themes/osi/functions.php +++ b/themes/osi/functions.php @@ -427,26 +427,37 @@ function osi_wpdc_comment_body( string $comment_body ) { add_filter( 'wpdc_comment_body', 'osi_wpdc_comment_body', 10, 1 ); /** - * * Create a new Supporter in ACF, based on a Contact Forms 7 submission. - * */ -add_action('wpcf7_before_send_mail', 'save_form_data_to_cpt'); -function save_form_data_to_cpt($contact_form) { - $submission = WPCF7_Submission::get_instance(); - if ($submission) { - $data = $submission->get_posted_data(); - - $post_id = wp_insert_post(array( - 'post_title' => $data['your-name'], - 'post_type' => 'supporter', - 'post_status' => 'pending' - )); - update_field('name', $data['your-name'], $post_id); - update_field('organization', $data['your-org'], $post_id); - update_field('endorsement_type', $data['your-endorsement'], $post_id); - update_field('quote', $data['your-message'], $post_id); - } else { - error_log('WPCF7_Submission instance is null.'); - } + +add_action( 'wpcf7_before_send_mail', 'save_form_data_to_cpt' ); + +/** + * Save form data to a custom post type. + * + * @param WPCF7_ContactForm $contact_form The Contact Form 7 instance. + */ +function save_form_data_to_cpt( $contact_form ) { + $submission = WPCF7_Submission::get_instance(); + + if ( $submission ) { + $data = $submission->get_posted_data(); + + $post_id = wp_insert_post( + array( + 'post_title' => $data['your-name'], + 'post_type' => 'supporter', + 'post_status' => 'pending', + ) + ); + + if ( $post_id ) { + update_field( 'name', $data['your-name'], $post_id ); + update_field( 'organization', $data['your-org'], $post_id ); + update_field( 'endorsement_type', $data['your-endorsement'], $post_id ); + update_field( 'quote', $data['your-message'], $post_id ); + } else { + error_log( 'Failed to insert post for supporter.' ); + } + } } \ No newline at end of file From 634cd69d45742b41a393367f093acb41b57195fe Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 13:58:40 +0000 Subject: [PATCH 4/9] Fixed phpcs issues --- .../acf-fields/group_672accc71e0c4.json | 134 ++++++++++++++++++ .../acf-fields/post_type_672acc9b32c0c.json | 89 ++++++++++++ themes/osi/functions.php | 60 ++++---- 3 files changed, 253 insertions(+), 30 deletions(-) create mode 100644 plugins/osi-features/acf-fields/group_672accc71e0c4.json create mode 100644 plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json diff --git a/plugins/osi-features/acf-fields/group_672accc71e0c4.json b/plugins/osi-features/acf-fields/group_672accc71e0c4.json new file mode 100644 index 0000000..2ffed88 --- /dev/null +++ b/plugins/osi-features/acf-fields/group_672accc71e0c4.json @@ -0,0 +1,134 @@ +{ + "key": "group_672accc71e0c4", + "title": "Supporter fields", + "fields": [ + { + "key": "field_672accc74e66e", + "label": "Name", + "name": "name", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "default_value": "", + "maxlength": "", + "allow_in_bindings": 0, + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_672accd44e66f", + "label": "Organization", + "name": "organization", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "default_value": "", + "maxlength": "", + "allow_in_bindings": 0, + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_672ad07b77def", + "label": "Link", + "name": "link", + "aria-label": "", + "type": "url", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "default_value": "", + "allow_in_bindings": 0, + "placeholder": "" + }, + { + "key": "field_672accda4e670", + "label": "Quote", + "name": "quote", + "aria-label": "", + "type": "textarea", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "default_value": "", + "maxlength": "", + "allow_in_bindings": 0, + "rows": "", + "placeholder": "", + "new_lines": "" + }, + { + "key": "field_672ade5b950a0", + "label": "Order", + "name": "order", + "aria-label": "", + "type": "number", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "default_value": "", + "min": "", + "max": "", + "allow_in_bindings": 0, + "placeholder": "", + "step": "", + "prepend": "", + "append": "" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "supporter" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": 0, + "modified": 1733133647 +} diff --git a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json new file mode 100644 index 0000000..d98336c --- /dev/null +++ b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json @@ -0,0 +1,89 @@ +{ + "key": "post_type_672acc9b32c0c", + "title": "Supporters", + "menu_order": 0, + "active": true, + "post_type": "supporter", + "advanced_configuration": true, + "import_source": "", + "import_date": "", + "labels": { + "name": "Supporters", + "singular_name": "Supporter", + "menu_name": "Supporters", + "all_items": "All Supporters", + "edit_item": "Edit Supporter", + "view_item": "View Supporter", + "view_items": "View Supporters", + "add_new_item": "Add New Supporter", + "add_new": "Add New Supporter", + "new_item": "New Supporter", + "parent_item_colon": "Parent Supporter:", + "search_items": "Search Supporters", + "not_found": "No supporters found", + "not_found_in_trash": "No supporters found in Trash", + "archives": "Supporter Archives", + "attributes": "Supporter Attributes", + "featured_image": "", + "set_featured_image": "", + "remove_featured_image": "", + "use_featured_image": "", + "insert_into_item": "Insert into supporter", + "uploaded_to_this_item": "Uploaded to this supporter", + "filter_items_list": "Filter supporters list", + "filter_by_date": "Filter supporters by date", + "items_list_navigation": "Supporters list navigation", + "items_list": "Supporters list", + "item_published": "Supporter published.", + "item_published_privately": "Supporter published privately.", + "item_reverted_to_draft": "Supporter reverted to draft.", + "item_scheduled": "Supporter scheduled.", + "item_updated": "Supporter updated.", + "item_link": "Supporter Link", + "item_link_description": "A link to a supporter." + }, + "description": "", + "public": true, + "hierarchical": false, + "exclude_from_search": false, + "publicly_queryable": true, + "show_ui": true, + "show_in_menu": true, + "admin_menu_parent": "", + "show_in_admin_bar": true, + "show_in_nav_menus": true, + "show_in_rest": true, + "rest_base": "", + "rest_namespace": "wp\/v2", + "rest_controller_class": "WP_REST_Posts_Controller", + "menu_position": "", + "menu_icon": { + "type": "dashicons", + "value": "dashicons-admin-post" + }, + "rename_capabilities": false, + "singular_capability_name": "post", + "plural_capability_name": "posts", + "supports": [ + "title", + "thumbnail", + "custom-fields" + ], + "taxonomies": "", + "has_archive": false, + "has_archive_slug": "", + "rewrite": { + "permalink_rewrite": "custom_permalink", + "slug": "supporter", + "with_front": "1", + "feeds": "0", + "pages": "1" + }, + "query_var": "post_type_key", + "query_var_name": "", + "can_export": true, + "delete_with_user": false, + "register_meta_box_cb": "", + "enter_title_here": "", + "modified": 1734435097 +} diff --git a/themes/osi/functions.php b/themes/osi/functions.php index d0121d4..dc965af 100755 --- a/themes/osi/functions.php +++ b/themes/osi/functions.php @@ -426,38 +426,38 @@ function osi_wpdc_comment_body( string $comment_body ) { } add_filter( 'wpdc_comment_body', 'osi_wpdc_comment_body', 10, 1 ); -/** - * Create a new Supporter in ACF, based on a Contact Forms 7 submission. - */ - -add_action( 'wpcf7_before_send_mail', 'save_form_data_to_cpt' ); - /** * Save form data to a custom post type. * * @param WPCF7_ContactForm $contact_form The Contact Form 7 instance. + * + * @return void */ -function save_form_data_to_cpt( $contact_form ) { - $submission = WPCF7_Submission::get_instance(); - - if ( $submission ) { - $data = $submission->get_posted_data(); - - $post_id = wp_insert_post( - array( - 'post_title' => $data['your-name'], - 'post_type' => 'supporter', - 'post_status' => 'pending', - ) - ); - - if ( $post_id ) { - update_field( 'name', $data['your-name'], $post_id ); - update_field( 'organization', $data['your-org'], $post_id ); - update_field( 'endorsement_type', $data['your-endorsement'], $post_id ); - update_field( 'quote', $data['your-message'], $post_id ); - } else { - error_log( 'Failed to insert post for supporter.' ); - } - } -} \ No newline at end of file +function osi_save_form_data_to_cpt( WPCF7_ContactForm $contact_form ): void { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found + $submission = WPCF7_Submission::get_instance(); + + if ( $submission ) { + $data = $submission->get_posted_data(); + + $post_id = wp_insert_post( + array( + 'post_title' => $data['your-name'], + 'post_type' => 'supporter', + 'post_status' => 'pending', + ) + ); + + // If we have a wp_error, abort. + if ( is_wp_error( $post_id ) ) { + return; + } + + if ( $post_id ) { + update_field( 'name', $data['your-name'], $post_id ); + update_field( 'organization', $data['your-org'], $post_id ); + update_field( 'endorsement_type', $data['your-endorsement'], $post_id ); + update_field( 'quote', $data['your-message'], $post_id ); + } + } +} +add_action( 'wpcf7_before_send_mail', 'osi_save_form_data_to_cpt' ); From ad5ad942d52df7b282cd900571c67f8c9ec87d41 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 14:37:19 +0000 Subject: [PATCH 5/9] Remove the front from the supporter permalinks --- .../acf-fields/post_type_672acc9b32c0c.json | 4 +- .../inc/helpers/custom-functions.php | 38 ++++++++----------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json index d98336c..06fb97a 100644 --- a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json +++ b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json @@ -75,7 +75,7 @@ "rewrite": { "permalink_rewrite": "custom_permalink", "slug": "supporter", - "with_front": "1", + "with_front": "0", "feeds": "0", "pages": "1" }, @@ -85,5 +85,5 @@ "delete_with_user": false, "register_meta_box_cb": "", "enter_title_here": "", - "modified": 1734435097 + "modified": 1737124331 } diff --git a/plugins/osi-features/inc/helpers/custom-functions.php b/plugins/osi-features/inc/helpers/custom-functions.php index f273e54..eed88fa 100644 --- a/plugins/osi-features/inc/helpers/custom-functions.php +++ b/plugins/osi-features/inc/helpers/custom-functions.php @@ -37,7 +37,7 @@ function osi_get_cache_key( $unique = '' ) { function osi_get_cached_posts( $args ) { if ( empty( $args ) || ! is_array( $args ) ) { - return []; + return array(); } $args['suppress_filters'] = false; @@ -47,9 +47,9 @@ function osi_get_cached_posts( $args ) { $cache_key = osi_get_cache_key( $args ); $cache = new \Osi\Features\Inc\Cache( $cache_key ); - $result = $cache->expires_in( $expires_in )->updates_with( 'get_posts', [ $args ] )->get(); + $result = $cache->expires_in( $expires_in )->updates_with( 'get_posts', array( $args ) )->get(); - return ( ! empty( $result ) && is_array( $result ) ) ? $result : []; + return ( ! empty( $result ) && is_array( $result ) ) ? $result : array(); } /** @@ -60,7 +60,7 @@ function osi_get_cached_posts( $args ) { * * @return string Template markup. */ -function osi_get_template_content( $slug, $vars = [] ) { +function osi_get_template_content( $slug, $vars = array() ) { ob_start(); @@ -69,19 +69,18 @@ function osi_get_template_content( $slug, $vars = [] ) { $markup = ob_get_clean(); return $markup; - } /** * Get plugin template. * - * @param string $template Name or path of the template within /templates folder without php extension. - * @param array $variables pass an array of variables you want to use in template. - * @param bool $echo Whether to echo out the template content or not. + * @param string $template Name or path of the template within /templates folder without php extension. + * @param array $variables pass an array of variables you want to use in template. + * @param boolean $echo Whether to echo out the template content or not. * * @return string|void Template markup. */ -function osi_template( $template, $variables = [], $echo = false ) { +function osi_template( $template, $variables = array(), $echo = false ) { $template_file = sprintf( '%1$s/templates/%2$s.php', OSI_PATH, $template ); @@ -104,31 +103,27 @@ function osi_template( $template, $variables = [], $echo = false ) { } echo $markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped already in template. - } /** * Get data file content from '/data' directory. * - * @param string $slug file Data file name without '.php' extention. - * @param array $default Default value to return if file not found. + * @param string $slug file Data file name without '.php' extention. + * @param array $default Default value to return if file not found. * * @return mixed Data file content. */ -function osi_get_data( $slug, $default = [] ) { +function osi_get_data( $slug, $default = array() ) { $data_file = sprintf( OSI_PATH . '/inc/data/%s.php', $slug ); if ( file_exists( $data_file ) ) { - $file_content = require $data_file; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable return $file_content; - } return $default; - } /** @@ -139,7 +134,7 @@ function osi_get_data( $slug, $default = [] ) { * @see https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/ * @see https://lobby.vip.wordpress.com/2020/08/20/environment-type-support/ * - * @return bool Return true if it's production else return false. + * @return boolean Return true if it's production else return false. */ function osi_is_production() { @@ -148,17 +143,16 @@ function osi_is_production() { } return false; - } /** * Determine if the current User Agent matches the passed $kind * - * @param string $kind Category of mobile device to check for. - * Either: any, dumb, smart. - * @param bool $return_matched_agent Boolean indicating if the UA should be returned. + * @param string $kind Category of mobile device to check for. + * Either: any, dumb, smart. + * @param boolean $return_matched_agent Boolean indicating if the UA should be returned. * - * @return bool|string Boolean indicating if current UA matches $kind. If + * @return boolean|string Boolean indicating if current UA matches $kind. If * $return_matched_agent is true, returns the UA string */ function osi_is_mobile( $kind = 'any', $return_matched_agent = false ) { From 6431282573cb0a6e2d68b30ecfb2ff03dc679565 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 14:37:19 +0000 Subject: [PATCH 6/9] Revert "Remove the front from the supporter permalinks" This reverts commit ad5ad942d52df7b282cd900571c67f8c9ec87d41. --- .../acf-fields/post_type_672acc9b32c0c.json | 4 +- .../inc/helpers/custom-functions.php | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json index 06fb97a..d98336c 100644 --- a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json +++ b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json @@ -75,7 +75,7 @@ "rewrite": { "permalink_rewrite": "custom_permalink", "slug": "supporter", - "with_front": "0", + "with_front": "1", "feeds": "0", "pages": "1" }, @@ -85,5 +85,5 @@ "delete_with_user": false, "register_meta_box_cb": "", "enter_title_here": "", - "modified": 1737124331 + "modified": 1734435097 } diff --git a/plugins/osi-features/inc/helpers/custom-functions.php b/plugins/osi-features/inc/helpers/custom-functions.php index eed88fa..f273e54 100644 --- a/plugins/osi-features/inc/helpers/custom-functions.php +++ b/plugins/osi-features/inc/helpers/custom-functions.php @@ -37,7 +37,7 @@ function osi_get_cache_key( $unique = '' ) { function osi_get_cached_posts( $args ) { if ( empty( $args ) || ! is_array( $args ) ) { - return array(); + return []; } $args['suppress_filters'] = false; @@ -47,9 +47,9 @@ function osi_get_cached_posts( $args ) { $cache_key = osi_get_cache_key( $args ); $cache = new \Osi\Features\Inc\Cache( $cache_key ); - $result = $cache->expires_in( $expires_in )->updates_with( 'get_posts', array( $args ) )->get(); + $result = $cache->expires_in( $expires_in )->updates_with( 'get_posts', [ $args ] )->get(); - return ( ! empty( $result ) && is_array( $result ) ) ? $result : array(); + return ( ! empty( $result ) && is_array( $result ) ) ? $result : []; } /** @@ -60,7 +60,7 @@ function osi_get_cached_posts( $args ) { * * @return string Template markup. */ -function osi_get_template_content( $slug, $vars = array() ) { +function osi_get_template_content( $slug, $vars = [] ) { ob_start(); @@ -69,18 +69,19 @@ function osi_get_template_content( $slug, $vars = array() ) { $markup = ob_get_clean(); return $markup; + } /** * Get plugin template. * - * @param string $template Name or path of the template within /templates folder without php extension. - * @param array $variables pass an array of variables you want to use in template. - * @param boolean $echo Whether to echo out the template content or not. + * @param string $template Name or path of the template within /templates folder without php extension. + * @param array $variables pass an array of variables you want to use in template. + * @param bool $echo Whether to echo out the template content or not. * * @return string|void Template markup. */ -function osi_template( $template, $variables = array(), $echo = false ) { +function osi_template( $template, $variables = [], $echo = false ) { $template_file = sprintf( '%1$s/templates/%2$s.php', OSI_PATH, $template ); @@ -103,27 +104,31 @@ function osi_template( $template, $variables = array(), $echo = false ) { } echo $markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped already in template. + } /** * Get data file content from '/data' directory. * - * @param string $slug file Data file name without '.php' extention. - * @param array $default Default value to return if file not found. + * @param string $slug file Data file name without '.php' extention. + * @param array $default Default value to return if file not found. * * @return mixed Data file content. */ -function osi_get_data( $slug, $default = array() ) { +function osi_get_data( $slug, $default = [] ) { $data_file = sprintf( OSI_PATH . '/inc/data/%s.php', $slug ); if ( file_exists( $data_file ) ) { + $file_content = require $data_file; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable return $file_content; + } return $default; + } /** @@ -134,7 +139,7 @@ function osi_get_data( $slug, $default = array() ) { * @see https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/ * @see https://lobby.vip.wordpress.com/2020/08/20/environment-type-support/ * - * @return boolean Return true if it's production else return false. + * @return bool Return true if it's production else return false. */ function osi_is_production() { @@ -143,16 +148,17 @@ function osi_is_production() { } return false; + } /** * Determine if the current User Agent matches the passed $kind * - * @param string $kind Category of mobile device to check for. - * Either: any, dumb, smart. - * @param boolean $return_matched_agent Boolean indicating if the UA should be returned. + * @param string $kind Category of mobile device to check for. + * Either: any, dumb, smart. + * @param bool $return_matched_agent Boolean indicating if the UA should be returned. * - * @return boolean|string Boolean indicating if current UA matches $kind. If + * @return bool|string Boolean indicating if current UA matches $kind. If * $return_matched_agent is true, returns the UA string */ function osi_is_mobile( $kind = 'any', $return_matched_agent = false ) { From e634511e012940f4d35c8fee0eccd99b853cd406 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 14:41:39 +0000 Subject: [PATCH 7/9] House Keeping --- plugins/osi-features/inc/helpers/custom-functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/osi-features/inc/helpers/custom-functions.php b/plugins/osi-features/inc/helpers/custom-functions.php index f273e54..656e401 100644 --- a/plugins/osi-features/inc/helpers/custom-functions.php +++ b/plugins/osi-features/inc/helpers/custom-functions.php @@ -169,3 +169,4 @@ function osi_is_mobile( $kind = 'any', $return_matched_agent = false ) { return false; } + From 8e02d7b87938ebb8a07eefe8c8df919e8054d488 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 14:42:38 +0000 Subject: [PATCH 8/9] House Keeping --- plugins/osi-features/inc/helpers/custom-functions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/osi-features/inc/helpers/custom-functions.php b/plugins/osi-features/inc/helpers/custom-functions.php index 656e401..f273e54 100644 --- a/plugins/osi-features/inc/helpers/custom-functions.php +++ b/plugins/osi-features/inc/helpers/custom-functions.php @@ -169,4 +169,3 @@ function osi_is_mobile( $kind = 'any', $return_matched_agent = false ) { return false; } - From 3125a83711ed47d06a8b3ed97300afa98ff0e49d Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Fri, 17 Jan 2025 14:43:11 +0000 Subject: [PATCH 9/9] House Keeping --- plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json index d98336c..c1ce8c6 100644 --- a/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json +++ b/plugins/osi-features/acf-fields/post_type_672acc9b32c0c.json @@ -75,7 +75,7 @@ "rewrite": { "permalink_rewrite": "custom_permalink", "slug": "supporter", - "with_front": "1", + "with_front": "0", "feeds": "0", "pages": "1" }, @@ -86,4 +86,4 @@ "register_meta_box_cb": "", "enter_title_here": "", "modified": 1734435097 -} +} \ No newline at end of file