Ordercustomizer/panel.php 0000644 00000002140 14760002200 0010544 0 ustar 00 set_panel();
$this->set_section();
}
public function set_panel() {
$this->customizer->add_panel( [
'id' => $this->panelID,
'title' => esc_html__( 'Bookmark & Follow', 'soledad' ),
'priority' => $this->id,
] );
}
public function set_section() {
$this->add_lazy_section( 'penci_bookmark_follow_general_section', esc_html__( 'General', 'penci-bookmark-follow' ), $this->panelID );
$this->add_lazy_section( 'penci_bookmark_follow_noti_section', esc_html__( 'Notifications Settings', 'penci-bookmark-follow' ), $this->panelID );
$this->add_lazy_section( 'penci_bookmark_follow_email_section', esc_html__( 'Email Settings', 'penci-bookmark-follow' ), $this->panelID );
$this->add_lazy_section( 'penci_bookmark_follow_translate_section', esc_html__( 'Quick Text Translation', 'penci-bookmark-follow' ), $this->panelID );
}
} customizer/settings.php 0000644 00000003135 14760002200 0011312 0 ustar 00 customizer = \SoledadFW\Customizer\Customizer::get_instance();
}
if ( is_customize_preview() || ! is_admin() ) {
add_filter( 'soledad_fw_register_lazy_section', array( $this, 'register_lazy_section' ) );
add_action( 'soledad_fw_register_customizer_option', array( $this, 'load_customizer' ), 95 );
}
}
/**
* @return Customizer
*/
public static function getInstance() {
if ( null === static::$instance ) {
static::$instance = new static();
}
return static::$instance;
}
public function register_lazy_section( $result ) {
$array = $this->list_section;
$path = dirname( __DIR__ ) . '/customizer/';
foreach ( $array as $id ) {
$result[ $id ][] = "{$path}{$id}.php";
}
return $result;
}
public function load_customizer() {
$this->customizer = Customizer\Customizer::get_instance();
new Customizer\PenciBF_Option( $this->customizer, 206 );
}
}
customizer/penci_bookmark_follow_noti_section.php 0000644 00000007077 14760002200 0016605 0 ustar 00 'pencibf_double_opt_in',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Require Email Confirmation', 'penci-bookmark-follow' ),
'description' => esc_html__( 'When enable, Registered users will be sent a confirmation email to subscribe, and will only be added once they confirmed the subscription', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_email_01',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Posts Notification Events', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_post_trigger_notification_post_update',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Email: When post / page updated', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_post_trigger_notification_new_comment',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Email: When new comment added', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_email_03',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Author Notification Events', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_trigger_notification_post_published',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Email: When post / page published', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_trigger_notification_post_update',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Email: When post / page updated', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_trigger_notification_new_comment',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Email: When new comment added', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_email_02',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Popup Notifications', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_enable_popup_notify',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'default' => true,
'label' => esc_html__( 'Enable Popup Notify', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_notify_text_cl',
'transport' => 'postMessage',
'type' => 'soledad-fw-color',
'label' => esc_html__( 'Popup Text Color', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_notify_bg_cl',
'transport' => 'postMessage',
'type' => 'soledad-fw-color',
'label' => esc_html__( 'Popup Background Color', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_notify_timeout',
'transport' => 'postMessage',
'default' => '2000',
'type' => 'soledad-fw-number',
'label' => esc_html__( 'Popup Timeout', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_position',
'transport' => 'postMessage',
'default' => 'bottom-center',
'type' => 'soledad-fw-select',
'label' => esc_html__( 'Popup Position', 'penci-bookmark-follow' ),
'choices' => [
'top-left' => 'Top Left',
'top-right' => 'Top Right',
'top-center' => 'Top Center',
'mid-center' => 'Middle Center',
'bottom-left' => 'Bottom Left',
'bottom-right' => 'Bottom Right',
'bottom-center' => 'Bottom Center',
]
);
return $options; customizer/penci_bookmark_follow_general_section.php 0000644 00000020207 14760002200 0017237 0 ustar 00 'pencibf_disable_header_icon',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Disable Header Bookmark Icon', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_01',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Posts Type Follows', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_prevent_type',
'default' => ['post'],
'sanitize' => 'penci_sanitize_multiple_checkbox',
'label' => __( 'Enable Support in Post Types', 'soledad' ),
'type' => 'soledad-fw-select',
'multiple' => 999,
'choices' => call_user_func( function () {
$exclude = array(
'attachment',
'revision',
'nav_menu_item',
'safecss',
'penci-block',
'penci_builder',
'custom-post-template',
'archive-template',
);
$registered = get_post_types( [ 'show_in_nav_menus' => true ], 'objects' );
$types = array();
foreach ( $registered as $post ) {
if ( in_array( $post->name, $exclude ) ) {
continue;
}
$types[ $post->name ] = $post->label;
}
return $types;
} )
);
$options[] = array(
'id' => 'pencibf_disable_follow_guest',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Disable Guest Followers', 'penci-bookmark-follow' ),
'description' => esc_html__( 'Guests (non-logged-in users) have the permission to follow any post by default. If you check this option, then Follow button would not be displayed for Guest users.', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_enable_notify_followers',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Auto Send Email Notification for Followers', 'penci-bookmark-follow' ),
'description' => esc_html__( 'If this option is checked, whenever the post is edited or receives new comments, the followers will receive an email notification.', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_disable_auto_follow_add_comment',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Disable Email Notify When Comment Added', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This option allows you to disable email notifications when a post receives a new comment. It applies when you have checked the "Auto Send Email Notification for Followers" option mentioned above.', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_custom_subscribe_page',
'transport' => 'postMessage',
'type' => 'soledad-fw-ajax-select',
'description' => __( 'After selecting a custom bookmark page, you need to insert the shortcodes [pencibf_follow_post_list] and [pencibf_follow_author_list] into the page to display the bookmarked content.','penci-bookmark-follow'),
'choices' => call_user_func( function () {
$builder_layout = [ '' => '- Select -' ];
$builder_layouts = get_posts( [
'post_type' => 'page',
'posts_per_page' => - 1,
] );
foreach ( $builder_layouts as $builder_builder ) {
$builder_layout[ $builder_builder->ID ] = $builder_builder->post_title;
}
return $builder_layout;
} ),
'label' => esc_html__( 'Custom Bookmark Page', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_custom_unsubscribe_page',
'transport' => 'postMessage',
'type' => 'soledad-fw-ajax-select',
'description' => __( 'After selecting a custom Unsubscribe page, you need to insert the shortcodes [pencibf_unsubscribe] into the page to display the Unsubscribe Form.','penci-bookmark-follow'),
'choices' => call_user_func( function () {
$builder_layout = [ '' => '- Select -' ];
$builder_layouts = get_posts( [
'post_type' => 'page',
'posts_per_page' => - 1,
] );
foreach ( $builder_layouts as $builder_builder ) {
$builder_layout[ $builder_builder->ID ] = $builder_builder->post_title;
}
return $builder_layout;
} ),
'label' => esc_html__( 'Custom Unsubscribe Email Bookmark Page', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_custom_cat_page',
'transport' => 'postMessage',
'type' => 'soledad-fw-ajax-select',
'description' => __( 'Select the page that you\'ve inserted the Category Listing element.','penci-bookmark-follow'),
'choices' => call_user_func( function () {
$builder_layout = [ '' => '- Select -' ];
$builder_layouts = get_posts( [
'post_type' => 'page',
'posts_per_page' => - 1,
] );
foreach ( $builder_layouts as $builder_builder ) {
$builder_layout[ $builder_builder->ID ] = $builder_builder->post_title;
}
return $builder_layout;
} ),
'label' => esc_html__( 'Custom Category Listing Page', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_04',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Bookmark Page Settings', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_number_ppp',
'transport' => 'postMessage',
'default' => '6',
'type' => 'soledad-fw-number',
'label' => esc_html__( 'Number of Bookmark Items Per Page', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_show_postdate',
'sanitize' => 'penci_sanitize_checkbox_field',
'default' => true,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Show Post Date', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_show_author',
'sanitize' => 'penci_sanitize_checkbox_field',
'default' => true,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Show Post Author', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_show_comments',
'sanitize' => 'penci_sanitize_checkbox_field',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Show Post Comment Count', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_show_views',
'sanitize' => 'penci_sanitize_checkbox_field',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Show Post Views', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_show_reading',
'sanitize' => 'penci_sanitize_checkbox_field',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Show Post Reading Time', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_06',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Colors', 'penci-bookmark-follow' ),
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Color',
'id' => 'pencibf_bm_cl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Border Color',
'id' => 'pencibf_bm_bcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Background Color',
'id' => 'pencibf_bm_bgcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Hover Color',
'id' => 'pencibf_bm_hcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Hover Border Color',
'id' => 'pencibf_bm_hbcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmark Hover Background Color',
'id' => 'pencibf_bm_hbgcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmarked Color',
'id' => 'pencibf_bm_bmcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmarked Border Color',
'id' => 'pencibf_bm_bmbcl',
);
$options[] = array(
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => 'Bookmarked Background Color',
'id' => 'pencibf_bm_bmbgcl',
);
return $options; customizer/penci_bookmark_follow_translate_section.php 0000644 00000014615 14760002200 0017625 0 ustar 00 'pencibf_header_12',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Posts Follows', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_followtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Bookmark', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Bookmark', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_followingtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Bookmarked', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Bookmarked', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_unfollowtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Un-bookmark', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Un-bookmark', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_03',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Author Follows', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_followtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Follow', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Follow', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_followingtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Following', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Following', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_unfollowtext',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Unfollow', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Text: Unfollow', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_heading_02',
'transport' => 'postMessage',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Post Popup Content', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_title',
'transport' => 'postMessage',
'default' => __( 'Success', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Heading Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_mess',
'transport' => 'postMessage',
'default' => __( 'Post added to Bookmark', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Message', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_title',
'transport' => 'postMessage',
'default' => __( 'Removed', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Post Remove Heading Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_mess',
'transport' => 'postMessage',
'default' => __( 'Post remove from Bookmark list', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Post Remove Message', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_heading_03',
'transport' => 'postMessage',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Author Popup Content', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_author_title',
'transport' => 'postMessage',
'default' => __( 'Success', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Heading Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_author_mess',
'transport' => 'postMessage',
'default' => __( 'Successfully add author from the favorite list', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Content', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_author_title',
'transport' => 'postMessage',
'default' => __( 'Removed', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Author Remove Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_author_mess',
'transport' => 'postMessage',
'default' => __( 'Successfully remove author from the favorite list', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Author Remove Message', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_heading_term',
'transport' => 'postMessage',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Term Popup Content', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_term_title',
'transport' => 'postMessage',
'default' => __( 'Success', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Heading Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_success_term_mess',
'transport' => 'postMessage',
'default' => __( 'Successfully add category from the favorite list', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Success Content', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_term_title',
'transport' => 'postMessage',
'default' => __( 'Removed', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Author Remove Title', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_popup_remove_term_mess',
'transport' => 'postMessage',
'default' => __( 'Successfully remove category from the favorite list', 'penci-bookmark-follow' ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Author Remove Message', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_other',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Other Texts', 'penci-bookmark-follow' ),
);
$texts = pencibg_default_text();
foreach ( $texts as $id => $text ) {
$options[] = array(
'id' => 'pencibf_text_' . $id,
'type' => 'soledad-fw-text',
'default' => $text,
'label' => esc_html__( 'Text:' . $text, 'penci-bookmark-follow' ),
);
}
return $options; customizer/penci_bookmark_follow_email_section.php 0000644 00000026425 14760002200 0016721 0 ustar 00 'pencibf_from_email',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'From Email Address', 'penci-bookmark-follow' ),
'description' => esc_html__( 'When enable, Registered users will be sent a confirmation email to subscribe, and will only be added once they confirmed the subscription', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_enable_unsubscribe_url',
'transport' => 'postMessage',
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Add Unsubscribe link to email Message', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_unsubscribe_message',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'value' => 'If you want to unsubscribe, click on {unsubscribe_url}',
'label' => esc_html__( 'Unsubscribe Message', 'penci-bookmark-follow' ),
'description' => esc_html__( 'Enter the custom Unsubscribe Message. Available template tags for unsubscribe message are: {unsubscribe_url} - displays the unsubscribe url for unsubscribe email', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_01',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Edit Post Subscription Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Post {post_name} updated at {site_name}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This is the subject of the email that will be sent to the followers of that post when post is updated. Available template tags for subject fields are :{post_name} - displays the title of the post, {site_name} - displays the name of your site ', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( 'Post {post_name} updated If you want to see page click below link {post_link} for {site_link}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the followers of that post when post is updated.
The available tags are:
{post_name}
- displays the title of the post
{post_link}
- displays the post title with link
{site_name}
- displays the name of your site
{site_link}
- displays the site name with link', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_03',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'New Post Author Subscription Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Post {post_name} updated at {site_name}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This is the subject of the email that will be sent to the followers of that post when post is updated. Available template tags for subject fields are :{post_name} - displays the title of the post, {site_name} - displays the name of your site ', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( 'New post added by the author "{author_name}": {post_name} {post_description} If you want to see page click below link {post_link} for {site_link}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the followers of that post when post is updated.
The available tags are:
{post_name}
- displays the title of the post
{post_link}
- displays the post title with link
{site_name}
- displays the name of your site
{site_link}
- displays the site name with link', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_04',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Comment Subscription Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_comment_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'New comment on "{post_name}" by {user_name}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This is the subject of the email that will be sent to the followers of that post when post is updated. Available template tags for subject fields are :{post_name} - displays the title of the post, {site_name} - displays the name of your site ', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_comment_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( 'New comment added on the post "{post_name}" by {user_name}, see below : {comment_text}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the followers of that post when post is updated.
The available tags are:
{post_name}
- displays the title of the post
{post_link}
- displays the post title with link
{site_name}
- displays the name of your site
{site_link}
- displays the site name with link', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_05',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Posts Confirmation Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_confirm_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Follow {post_name} - {site_name}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This is the subject of the email that will be sent to the followers of that post when post is updated. Available template tags for subject fields are :{post_name} - displays the title of the post, {site_name} - displays the name of your site ', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_confirm_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( 'Hello You recently followed below blog post. This means you will receive an email when post is updated. Blog Post URL: {post_link} To activate, click confirm below. If you did not request this, please feel free to disregard this notice! {subscribe_url} Thanks', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the followers of that post when post is updated.
The available tags are:
{post_name}
- displays the title of the post
{post_link}
- displays the post title with link
{site_name}
- displays the name of your site
{site_link}
- displays the site name with link', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_07',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Author Confirmation Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_confirm_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( 'Follow {author_name} - {site_name}', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( '
This is the subject of the email that will be sent to the user for confirming his email address for subscription of any authors. Available template tags for subject fields are :
{author_name} - displays the name of author
{site_name} - displays the name of your site', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_author_confirm_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( 'Hello You recently followed the author "{author_name}". This means you will receive an email when any new post is published by the author "{author_name}". To activate, click confirm below. If you did not request this, please feel free to disregard this notice! {subscribe_url} Thanks', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the user for confirming his email address for subscription of any authors. The available tags are:
{author_name} - displays the name of the author
{site_name} - displays the name of your site
{site_link} - displays the site name with link
{subscribe_url} - displays the subscribe url for confirm email subscription.', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_header_notify_08',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Unsubscribe Confirmation Email Template', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_unsubscribe_confirm_email_subject',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'default' => __( '[{site_name}] Please confirm your unsubscription request', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'description' => esc_html__( 'This is the subject of the email that will be sent to the user for confirming his email address for unsubscription. Available template tags for subject fields are :
{email} - displays the follower\'s email
{site_name} - displays the name of your site', 'penci-bookmark-follow' ),
);
$options[] = array(
'id' => 'pencibf_unsubscribe_confirm_email_body',
'transport' => 'postMessage',
'type' => 'soledad-fw-textarea',
'default' => __( '{site_name} has received a request to unsubscribe for this email address. To complete your request please click on the link below: {confirm_url} If you did not request this, please feel free to disregard this notice!". To activate, click confirm below. If you did not request this, please feel free to disregard this notice! {subscribe_url} Thanks', 'penci-bookmark-follow' ),
'label' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'description' => __( 'This is the body, main content of the email that will be sent to the user for confirming his email address for unsubscription. The available tags are:
{email} - displays the follower\'s email
{site_name} - displays the name of your site
{site_link} - displays the site name with link
{confirm_url} - displays the confirm url for confirm email unsubscription.', 'penci-bookmark-follow' ),
);
return $options; inc/admin/forms/penci-bf-users-logs-list-authors.php 0000644 00000030700 14760002200 0016453 0 ustar 00 model = $penci_bl_model;
//Set parent defaults
parent::__construct( array(
'singular' => 'userlog', //singular name of the listed records
'plural' => 'userlogs', //plural name of the listed records
'ajax' => false //does this table support ajax?
) );
}
/**
* Displaying Followed author User Logs
*
* Does prepare the data for displaying followed post users in the table.
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function display_follow_author_user_logs() {
$prefix = PENCI_BL_META_PREFIX;
//if search is call then pass searching value to function for displaying searching values
$args = array();
$args['logid'] = $_GET['logid'];
//in case of search make parameter for retriving search data
if(isset($_REQUEST['s']) && !empty($_REQUEST['s'])) {
$args['search'] = $_REQUEST['s'];
}
//get followed post list data from database
$data = $this->model->penci_bl_get_follow_author_user_logs_data( $args );
foreach ($data as $key => $value){
// get email data from meta field
$email_data = get_post_meta( $value['ID'], $prefix.'log_email_data', true );
$mail_part = explode( '%$%$%', $email_data );
// set data
$data[$key]['mail_subject'] = isset( $mail_part[0] ) ? $mail_part[0] : '';
$data[$key]['mail_body'] = isset( $mail_part[1] ) ? $mail_part[1] : '';
}
return $data;
}
/**
* Mange column data
*
* Default Column for listing table
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function column_default( $item, $column_name ){
switch( $column_name ) {
case 'mail_subject' :
return $item[ $column_name ];
case 'mail_body' :
return $item[ $column_name ];
case 'post_date' :
$date = date( get_option('date_format'), strtotime( $item[ $column_name ] ) );
return $date;
default:
return $item[ $column_name ];
}
}
/**
* Manage User Email Column
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function column_mail_subject($item){
$pagestr = $pagenumber = '';
if( isset( $_GET['paged'] ) ) { $pagestr = '&paged=%s'; $pagenumber = $_GET['paged']; }
//Build row action
$actions['delete'] = sprintf(''.esc_html__('Delete', 'penci-bookmark-follow').'','penci-bf-author','delete',$item['ID'],$_GET['authorid'],$_GET['logid'], $pagenumber );
//Return the title contents
return sprintf('%1$s %2$s',
$item['mail_subject'],
$this->row_actions( $actions )
);
}
function column_cb($item){
return sprintf(
'',
$this->_args['singular'], //Let's simply repurpose the table's singular label ("movie")
$item['ID'] //The value of the checkbox should be the record's id
);
}
/**
* Display Columns
*
* Handles which columns to show in table
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function get_columns(){
$columns = array(
'cb' => '', //Render a checkbox instead of text
'mail_subject' => esc_html__( 'Email Subject', 'penci-bookmark-follow' ),
'mail_body' => esc_html__( 'Email Body', 'penci-bookmark-follow' ),
'post_date' => esc_html__( 'Post Date', 'penci-bookmark-follow' )
);
return $columns;
}
/**
* Sortable Columns
*
* Handles soratable columns of the table
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function get_sortable_columns() {
$sortable_columns = array(
'post_date' => array( 'post_date', true )
);
return $sortable_columns;
}
function no_items() {
//message to show when no records in database table
esc_html_e( 'No User Logs Found.', 'penci-bookmark-follow' );
}
/**
* Bulk actions field
*
* Handles Bulk Action combo box values
*
* @package Penci Bookmark Follow
* @since 1.0.0
*/
function get_bulk_actions() {
//bulk action combo box parameter
//if you want to add some more value to bulk action parameter then push key value set in below array
$actions = array(
'delete' => esc_html__('Delete','penci-bookmark-follow')
);
return $actions;
}
function prepare_items() {
/**
* First, lets decide how many records per page to show
*/
$per_page = '10';
/**
* REQUIRED. Now we need to define our column headers. This includes a complete
* array of columns to be displayed (slugs & titles), a list of columns
* to keep hidden, and a list of columns that are sortable. Each of these
* can be defined in another method (as we've done here) before being
* used to build the value for our _column_headers property.
*/
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
/**
* REQUIRED. Finally, we build an array to be used by the class for column
* headers. The $this->_column_headers property takes an array which contains
* 3 other arrays. One for all columns, one for hidden columns, and one
* for sortable columns.
*/
$this->_column_headers = array($columns, $hidden, $sortable);
/**
* Instead of querying a database, we're going to fetch the example data
* property we created for use in this plugin. This makes this example
* package slightly different than one you might build on your own. In
* this example, we'll be using array manipulation to sort and paginate
* our data. In a real-world implementation, you will probably want to
* use sort and pagination data to build a custom query instead, as you'll
* be able to use your precisely-queried data immediately.
*/
$data = $this->display_follow_author_user_logs();
/**
* This checks for sorting input and sorts the data in our array accordingly.
*
* In a real-world situation involving a database, you would probably want
* to handle sorting by passing the 'orderby' and 'order' values directly
* to a custom query. The returned data will be pre-sorted, and this array
* sorting technique would be unnecessary.
*/
function usort_reorder($a,$b){
$orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'post_date'; //If no sort, default to title
$order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'desc'; //If no order, default to asc
$result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
return ($order==='asc') ? $result : -$result; //Send final sort direction to usort
}
usort($data, 'usort_reorder');
/**
* REQUIRED for pagination. Let's figure out what page the user is currently
* looking at. We'll need this later, so you should always include it in
* your own package classes.
*/
$current_page = $this->get_pagenum();
/**
* REQUIRED for pagination. Let's check how many items are in our data array.
* In real-world use, this would be the total number of items in your database,
* without filtering. We'll need this later, so you should always include it
* in your own package classes.
*/
$total_items = count($data);
/**
* The WP_List_Table class does not handle pagination for us, so we need
* to ensure that the data is trimmed to only the current page. We can use
* array_slice() to
*/
$data = array_slice($data,(($current_page-1)*$per_page),$per_page);
/**
* REQUIRED. Now we can add our *sorted* data to the items property, where
* it can be used by the rest of the class.
*/
$this->items = $data;
/**
* REQUIRED. We also have to register our pagination options & calculations.
*/
$this->set_pagination_args( array(
'total_items' => $total_items, //WE have to calculate the total number of items
'per_page' => $per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages
) );
}
}
//Create an instance of our package class...
$FollowedUserLogsAuthorListTable = new Penci_Bf_User_Logs_List_Authors();
//Fetch, prepare, sort, and filter our data...
$FollowedUserLogsAuthorListTable->prepare_items();
$prefix = PENCI_BL_META_PREFIX;
?>
'.esc_html__("Record (s) deleted successfully.",'penci-bookmark-follow').'