Changeset 3435289
- Timestamp:
- 01/08/2026 04:23:58 PM (3 months ago)
- Location:
- supapress/trunk
- Files:
-
- 6 edited
-
admin/views/add-edit-partials/content.php (modified) (1 diff)
-
admin/views/add-edit-partials/elements.php (modified) (1 diff)
-
composer.json (modified) (1 diff)
-
includes/functions.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
supapress.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
supapress/trunk/admin/views/add-edit-partials/content.php
r2389550 r3435289 30 30 <div class="hide bulk lookup-source-input supapress-field-wrapper"> 31 31 <label class="supapress-label" for="isbn_lookup_bulk"><?php _e( 'Enter ISBN(s):', 'supapress' ); ?></label> 32 <textarea name="isbn_lookup_bulk" class="supapress-input" id="isbn_lookup_bulk" type="text" data-ajax-url="<?php echo admin_url('admin-ajax.php'); ?>" placeholder="Enter product ISBN(s) - one per line or comma separated "></textarea>32 <textarea name="isbn_lookup_bulk" class="supapress-input" id="isbn_lookup_bulk" type="text" data-ajax-url="<?php echo admin_url('admin-ajax.php'); ?>" placeholder="Enter product ISBN(s) - one per line or comma separated. Maximum 550 ISBNs allowed."></textarea> 33 33 <a id="supapress-add-bulk-isbns-button"><?php _e( 'Add ISBN(s)', 'supapress' ); ?></a> 34 34 </div> -
supapress/trunk/admin/views/add-edit-partials/elements.php
r3221654 r3435289 505 505 echo supapress_get_toggle_field( __( 'Subtitle', 'supapress' ), 'show_subtitle', $properties ); 506 506 echo supapress_get_toggle_field( __( 'Author name', 'supapress' ), 'show_author', $properties, '', $action ); 507 echo supapress_get_toggle_field( __( 'Author bio', 'supapress' ), 'show_author_bio', $properties );507 echo supapress_get_toggle_field( __( 'Author bio', 'supapress' ), 'show_author_bio', $properties, 'product_details' ); 508 508 echo supapress_get_toggle_field( __( 'Edition', 'supapress' ), 'show_edition', $properties ); 509 509 echo supapress_get_toggle_field( __( 'Format', 'supapress' ), 'show_format', $properties ); -
supapress/trunk/composer.json
r3397928 r3435289 3 3 "description": "Quickly and easily connect your book metadata (ONIX) to your WordPress site.", 4 4 "type": "wordpress-plugin", 5 "version": "2.2 6.9",5 "version": "2.27.0", 6 6 "authors": [ 7 7 { -
supapress/trunk/includes/functions.php
r3397928 r3435289 807 807 } 808 808 809 /** 810 * @param $field 811 * @param $value 812 * 813 * @return false|mixed|string|void|null 814 * 815 */ 816 817 function supapress_override_seo_field( $field = '', $value = '' ) { 818 819 $book_details_pages_array = get_option( 'widget_book_link_page' ); 820 821 // test if book details page has been set, or if on full details page 822 if( $book_details_pages_array === false || in_array( get_the_ID(), $book_details_pages_array ) === false ) { 823 return; 824 } 825 826 // check that the ISBN is set 827 $isbn = get_query_var('supapress_isbn'); 828 if (!preg_match('/\d{13}$/', $isbn)) { 829 return; 830 } 831 832 $extractedParams = supapress_extract_params_for_seo( get_the_ID() ); 833 834 $result = supapress_call_supafolio( 'book/' . get_query_var( 'supapress_isbn' ), $extractedParams ); 835 836 return supapress_run_seo_filters($result, $field); 837 838 } 839 add_action('get_header', 'supapress_override_seo_field'); 840 809 841 /** @type SupaPress_Book $supapress */ 810 842 function supapress_run_seo_filters($result, $field = '') { … … 897 929 898 930 if( $field !== '' ) { 899 900 /**901 * the below logic is included to maintain old functionality:902 *903 * the function supapress_call_supafolio_by_isbn_full_details() can also be used within a Yoast Hook:904 *905 * For example:906 *907 * add_filter( 'wpseo_title', function ( $title ) {908 * return supapress_call_supafolio_by_isbn_full_details( 'title', $title );909 * }, 15, 3 );910 *911 * however this will make a Supafolio call for each Yoast Hook that gets run912 *913 */914 915 931 if( $field === 'title' ) { 916 932 return $supapress_seo_override_title( $field ); … … 936 952 937 953 supapress_run_canonical_redirect($supapress_seo_override_url( $field )); 938 954 echo supapress_book_schema($supapress); 955 } 956 957 function supapress_book_schema($supapress) { 958 if (empty($supapress) || is_string($supapress)) { 959 return ''; 960 } 961 962 $isbn13 = $supapress->get_isbn13() ?? ""; 963 $bookTitle = $supapress->get_title() ?? ""; 964 $coverImage = $supapress->get_cover() ?? ""; 965 $contributors = $supapress->get_author_text() ?? ""; 966 967 if ($coverImage) { 968 $coverImage = preg_replace('/([?&])w=\d+/', '$1w=1500', $coverImage, -1, $count); 969 970 if (!$count) { 971 $coverImage .= (strpos($coverImage, '?') === false ? '?' : '&') . 'w=1500'; 972 } 973 } 974 975 $schema = apply_filters( 976 'supapress_schema', 977 [ 978 "@context" => "https://schema.org", 979 "@type" => "Book", 980 "name" => $bookTitle, 981 "isbn" => $isbn13, 982 "author" => [ 983 "@type" => "Person", 984 "name" => $contributors, 985 ], 986 "image" => [ 987 "@type" => "ImageObject", 988 "url" => $coverImage, 989 ], 990 ], 991 $supapress 992 ); 993 994 if( empty( $schema ) ) { 995 return ''; 996 } 997 998 return '<script type="application/ld+json">' . json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</script>'; 939 999 } 940 1000 … … 957 1017 exit(); 958 1018 } 959 }960 961 962 /**963 * @param $field964 * @param $value965 *966 * @return false|mixed|string|void|null967 *968 */969 970 function supapress_override_seo_field( $field = '', $value = '' ) {971 972 $book_details_pages_array = get_option( 'widget_book_link_page' );973 974 // test if book details page has been set, or if on full details page975 if( $book_details_pages_array === false || in_array( get_the_ID(), $book_details_pages_array ) === false ) {976 return;977 }978 979 // check that the ISBN is set980 $isbn = get_query_var('supapress_isbn');981 if (!preg_match('/\d{13}$/', $isbn)) {982 return;983 }984 985 $extractedParams = supapress_extract_params_for_seo( get_the_ID() );986 987 $result = supapress_call_supafolio( 'book/' . get_query_var( 'supapress_isbn' ), $extractedParams );988 989 return supapress_run_seo_filters($result, $field);990 991 }992 993 add_action('get_header', 'supapress_override_seo_field');994 995 996 /**997 * @param $field998 * @param $value999 *1000 * @return false|mixed|string|void|null1001 *1002 * the below function is depreciated. use the supapress_override_seo_field function run seo hooks1003 *1004 */1005 1006 function supapress_call_supafolio_by_isbn_full_details( $field, $value ) {1007 return supapress_override_seo_field( $field );1008 1019 } 1009 1020 -
supapress/trunk/readme.txt
r3397928 r3435289 3 3 Tags: supadü, supadu, folio, books, publishers, supafolio, supadu for wordpress, supapress, supafolio for wordpress 4 4 Requires at least: 6.0 5 Tested up to: 6. 8.36 Stable tag: 2.2 6.95 Tested up to: 6.9.0 6 Stable tag: 2.27.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 39 39 == Changelog == 40 41 = 2.27.0 = 42 Release Date: Jan 2026 43 * Change: add book schema on product page 44 * Change: edit placeholder for isbn-lookup field 45 * Bug: author_bio check removed from isbn-lookup modules 40 46 41 47 = 2.26.9 = -
supapress/trunk/supapress.php
r3397928 r3435289 7 7 * Plugin URI: https://www.supadu.com 8 8 * Description: Quickly and easily connect your book metadata (ONIX) to your WordPress site. 9 * Version: 2.2 6.99 * Version: 2.27.0 10 10 * Author: Supadü 11 11 * Author URI: https://www.supadu.com … … 37 37 defined( 'ABSPATH' ) or die( 'Illegal Access!' ); 38 38 39 define( 'SUPAPRESS_VERSION', '2.2 6.9' );39 define( 'SUPAPRESS_VERSION', '2.27.0' ); 40 40 41 41 define( 'SUPAPRESS_SITE_URL', get_site_url() );
Note: See TracChangeset
for help on using the changeset viewer.