Skip to content

Commit

Permalink
Merge pull request #2252 from ahmedkaludi/1.41
Browse files Browse the repository at this point in the history
1.41
  • Loading branch information
shridhamdeveloper authored Feb 15, 2025
2 parents 21eb672 + 084efdf commit a5528dd
Show file tree
Hide file tree
Showing 20 changed files with 721 additions and 93 deletions.
28 changes: 14 additions & 14 deletions admin_section/add-schema/add-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@
add_action( 'admin_init', 'saswp_add_new_init');
add_action( 'admin_footer', 'saswp_add_new_svg_sprite');
add_action( 'wp_ajax_saswp_add_new_save_steps_data', 'saswp_add_new_save_steps_data', 10, 0 );

function saswp_add_new_data_menu() {

saswp_add_new_init();

}

$saswp_add_data_type_config = array(
function saswp_add_new_init() {
// Exit if the user does not have proper permissions
if(! current_user_can( saswp_current_user_can() ) ) {
return ;
}
global $saswp_add_data_type_config;
$saswp_add_data_type_config = array(
'installer_dir' => 'admin_section',
'plugin_title' => 'Schema & Structured Data for WP',
'start_steps' => 1,
Expand Down Expand Up @@ -50,19 +62,7 @@
'title'=>'',
'step_id'=>1
)
);

function saswp_add_new_data_menu() {

saswp_add_new_init();

}

function saswp_add_new_init() {
// Exit if the user does not have proper permissions
if(! current_user_can( saswp_current_user_can() ) ) {
return ;
}
);
if ( ! isset( $_GET['_wpnonce']) ) {
return ;
}else{
Expand Down
23 changes: 23 additions & 0 deletions admin_section/common-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -3616,6 +3616,7 @@ function saswp_get_field_note($pname){
'jetpackrecipe' => esc_html__( 'Requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://structured-data-for-wp.com/recipe-schema/"> Jetpack Recipe Schema </a>',
'event_prime' => esc_html__( 'Requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://wordpress.org/plugins/eventprime-event-calendar-management/"> EventPrime – Events Calendar, Bookings and Tickets </a>',
'jolifaq' => esc_html__( 'Requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://wordpress.org/plugins/joli-faq-seo/"> Joli FAQ SEO – WordPress FAQ Plugin </a>',
'easy_liveblogs' => esc_html__( 'Requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://wordpress.org/plugins/easy-liveblogs/"> Easy Liveblogs </a>',

);

Expand Down Expand Up @@ -5431,4 +5432,26 @@ function saswp_filter_translatepress_content( $content ){

return $content;

}

/**
* Modify product name product in schema markup
* @param $title string
* @return $title string
* @since 1.41
*/
function saswp_get_the_product_title( $title = '' ) {

global $sd_data;

if( isset( $sd_data['saswp-full-heading'] ) && $sd_data['saswp-full-heading'] == 1 ) {
return $title;
}

if ( mb_strlen( $title, 'UTF-8' ) > 150 ) {
$title = mb_substr( $title, 0, 146, 'UTF-8' ) . ' ...';
}

return $title;

}
9 changes: 9 additions & 0 deletions admin_section/js/main-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,15 @@ jQuery(document).ready(function($){
$("#saswp-publish-press-authors").val(0);
}
break;

case 'saswp-easy-liveblogs-checkbox':
saswp_compatibliy_notes(current, id);
if ($(this).is(':checked')) {
$("#saswp-easy-liveblogs").val(1);
}else{
$("#saswp-easy-liveblogs").val(0);
}
break;

default:
break;
Expand Down
2 changes: 1 addition & 1 deletion admin_section/js/main-script.min.js

Large diffs are not rendered by default.

45 changes: 22 additions & 23 deletions admin_section/plugin-installer/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,27 @@
* @license Licensed GPLv3 for open source use
*/

$saswp_installer_config = array(


add_action( 'admin_menu', 'saswp_add_admin_menu' );
add_action( 'admin_init', 'saswp_installer_init');
add_action( 'admin_footer', 'saswp_svg_sprite');
add_action( 'wp_ajax_saswp_save_installer', 'saswp_save_steps_data', 10, 0 );

function saswp_add_admin_menu() {


saswp_installer_init();

}

function saswp_installer_init() {
// Exit if the user does not have proper permissions
if(! current_user_can( saswp_current_user_can() ) ) {
return ;
}
global $saswp_installer_config;
$saswp_installer_config = array(
'installer_dir' => 'plugin-installer',
'plugin_title' => 'Schema & Structured Data for WP',
'start_steps' => 1,
Expand Down Expand Up @@ -47,28 +67,7 @@
'title'=>'',
'step_id'=>1
)
);




add_action( 'admin_menu', 'saswp_add_admin_menu' );
add_action( 'admin_init', 'saswp_installer_init');
add_action( 'admin_footer', 'saswp_svg_sprite');
add_action( 'wp_ajax_saswp_save_installer', 'saswp_save_steps_data', 10, 0 );

function saswp_add_admin_menu() {

global $saswp_installer_config;
saswp_installer_init();

}

function saswp_installer_init() {
// Exit if the user does not have proper permissions
if(! current_user_can( saswp_current_user_can() ) ) {
return ;
}
);
if ( ! isset( $_GET['_saswp_nonce']) ) {
return;
}else{
Expand Down
25 changes: 21 additions & 4 deletions admin_section/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4411,6 +4411,19 @@ function saswp_compatibility_page_callback() {
'id' => 'saswp-publish-press-authors',
'name' => 'sd_data[saswp-publish-press-authors]',
)
);

$easy_liveblogs = array(
'label' => 'Easy Liveblogs',
'id' => 'saswp-easy-liveblogs-checkbox',
'name' => 'saswp-easy-liveblogs-checkbox',
'type' => 'checkbox',
'class' => 'checkbox saswp-checkbox',
'note' => saswp_get_field_note('easy_liveblogs'),
'hidden' => array(
'id' => 'saswp-easy-liveblogs',
'name' => 'sd_data[saswp-easy-liveblogs]',
)
);

if(!is_plugin_active('woocommerce-compatibility-for-schema/woocommerce-compatibility-for-schema.php') ) {
Expand Down Expand Up @@ -4507,9 +4520,12 @@ function saswp_compatibility_page_callback() {
$wpml['note'] = esc_html__( 'This feature requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://structured-data-for-wp.com/wpml-schema-compatibility">WPML Schema Compatibility Addon</a>';
}
if(!is_plugin_active('qanda-schema-for-saswp/qanda-schema-for-saswp.php') ) {

$sabaidiscuss['note'] = esc_html__( 'This feature requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://structured-data-for-wp.com/qanda-schema/">Q&A Schema Compatibility Addon</a>';
$wpqa_builder['note'] = esc_html__( 'This feature requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://structured-data-for-wp.com/qanda-schema/">Q&A Schema Compatibility Addon</a>';

$qnada_addon_req = esc_html__( 'This feature requires', 'schema-and-structured-data-for-wp' ) .' <a target="_blank" href="https://structured-data-for-wp.com/qanda-schema/">Q&A Schema Compatibility Addon</a>';

$sabaidiscuss['note'] = $qnada_addon_req;
$wpqa_builder['note'] = $qnada_addon_req;
$wpforo['note'] = $qnada_addon_req;
}

if(!is_plugin_active('event-schema-for-saswp/event-schema-for-saswp.php') ) {
Expand Down Expand Up @@ -4694,7 +4710,8 @@ function saswp_compatibility_page_callback() {
$novelist,
$flex_lmx,
$publishpress_authors,
$jolifaq
$jolifaq,
$easy_liveblogs,

);

Expand Down
8 changes: 7 additions & 1 deletion core/array-list/compatibility-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,13 @@
'free' => 'publishpress-authors/publishpress-authors.php',
'opt_name' => 'saswp-publish-press-authors',
'part_in' => 'free',
),
),
'easy_liveblogs' => array(
'name' => 'Easy Liveblogs',
'free' => 'easy-liveblogs/easy-liveblogs.php',
'opt_name' => 'saswp-easy-liveblogs',
'part_in' => 'free',
),
),
'themes' => array(
'enfold' => array(
Expand Down
26 changes: 26 additions & 0 deletions core/array-list/repeater-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@
),
'LearningResource' => array(
'learning-resource-educational-alignment' => 'learning_resource_educational_alignment',
),
'LiveBlogPosting' => array(
'live-blog-update' => 'live_blog_update',
)

),
Expand Down Expand Up @@ -1175,6 +1178,29 @@
'name' => 'saswp_lr_audience',
'type' => 'text'
),
),
'live_blog_update' => array(
array(
'label' => 'Headline',
'name' => 'saswp_lbp_lbu_headline',
'type' => 'text'
),
array(
'label' => 'Date Published',
'name' => 'saswp_lbp_lbu_date_published',
'type' => 'text',
'default' => get_the_date( 'Y-m-d' )
),
array(
'label' => 'Article Body',
'name' => 'saswp_lbp_lbu_article_body',
'type' => 'textarea',
),
array(
'label' => 'Image',
'name' => 'saswp_lbp_lbu_image',
'type' => 'media',
),
)

)
Expand Down
Loading

0 comments on commit a5528dd

Please sign in to comment.