Make WordPress Themes

Changeset 237640


Ignore:
Timestamp:
08/06/2024 08:24:28 AM (16 months ago)
Author:
themedropbox
Message:

New version of Educational Blocks - 1.8

Location:
educational-blocks/1.8
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • educational-blocks/1.8/functions.php

    r229638 r237640  
    6060
    6161// Get start function
     62
     63function educational_blocks_enqueue_admin_script($hook) {
     64    // Admin JS
     65    wp_enqueue_script('educational-blocks-admin-js', get_theme_file_uri('/inc/dashboard/admin.js'), array('jquery'), true);
     66    wp_localize_script(
     67        'educational-blocks-admin-js',
     68        'educational_blocks',
     69        array(
     70            'admin_ajax'    =>  admin_url('admin-ajax.php'),
     71            'wpnonce'           =>  wp_create_nonce('educational_blocks_dismissed_notice_nonce')
     72        )
     73    );
     74    wp_enqueue_script('educational-blocks-admin-js');
     75
     76    wp_localize_script( 'educational-blocks-admin-js', 'educational_blocks_scripts_localize',
     77        array( 'ajax_url' => admin_url( 'admin-ajax.php' ) )
     78    );
     79}
     80add_action('admin_enqueue_scripts', 'educational_blocks_enqueue_admin_script');
     81
     82//dismiss function
     83add_action( 'wp_ajax_educational_blocks_dismissed_notice_handler', 'educational_blocks_ajax_notice_dismiss_fuction' );
     84
     85function educational_blocks_ajax_notice_dismiss_fuction() {
     86    if (!wp_verify_nonce($_POST['wpnonce'], 'educational_blocks_dismissed_notice_nonce')) {
     87        exit;
     88    }
     89    if ( isset( $_POST['type'] ) ) {
     90        $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
     91        update_option( 'dismissed-' . $type, TRUE );
     92    }
     93}
     94
     95//get start box
    6296function educational_blocks_custom_admin_notice() {
    6397    // Check if the notice is dismissed
    64     if (!get_user_meta(get_current_user_id(), 'dismissed_admin_notice', true)) {
     98    if ( ! get_option('dismissed-get_started_notice', FALSE ) ) {
    6599        // Check if not on the theme documentation page
    66100        $educational_blocks_current_screen = get_current_screen();
     
    68102            $educational_blocks_theme = wp_get_theme();
    69103            ?>
    70             <div class="notice notice-info is-dismissible">
     104            <div class="notice notice-info is-dismissible" data-notice="get_started_notice">
    71105                <div class="notice-div">
    72106                    <div>
     
    74108                        <p><?php _e('For information and detailed instructions, check out our theme documentation.', 'educational-blocks'); ?></p>
    75109                    </div>
    76                     <a class="button-primary" href="themes.php?page=educational-blocks-guide-page"><?php _e('Theme Documentation', 'educational-blocks'); ?></a>
     110                    <div class="notice-buttons-box">
     111                        <a class="button-primary livedemo" href="<?php echo esc_url( EDUCATIONAL_BLOCKS_LIVE_DEMO ); ?>" target="_blank"><?php esc_html_e('Live Demo', 'educational-blocks'); ?></a>
     112                        <a class="button-primary buynow" href="<?php echo esc_url( EDUCATIONAL_BLOCKS_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Now', 'educational-blocks'); ?></a>
     113                        <a class="button-primary theme-install" href="themes.php?page=educational-blocks-guide-page"><?php _e('Theme Installation', 'educational-blocks'); ?></a>
     114                    </div>
    77115                </div>
    78116            </div>
     
    82120}
    83121add_action('admin_notices', 'educational_blocks_custom_admin_notice');
    84 // Dismiss notice function
    85 function educational_blocks_dismiss_admin_notice() {
    86     update_user_meta(get_current_user_id(), 'dismissed_admin_notice', true);
     122
     123//after switch theme
     124add_action('after_switch_theme', 'educational_blocks_after_switch_theme');
     125function educational_blocks_after_switch_theme () {
     126    update_option('dismissed-get_started_notice', FALSE );
    87127}
    88 add_action('wp_ajax_educational_blocks_dismiss_admin_notice', 'educational_blocks_dismiss_admin_notice');
    89 // Enqueue scripts and styles
    90 function educational_blocks_enqueue_admin_script($hook) {
    91     // Admin JS
    92     wp_enqueue_script('educational-blocks-admin.js', get_theme_file_uri('/inc/dashboard/admin.js'), array('jquery'), true);
    93    
    94     wp_localize_script('educational-blocks-admin.js', 'educational_blocks_scripts_localize', array(
    95         'ajax_url' => esc_url(admin_url('admin-ajax.php'))
    96     ));
    97 }
    98 add_action('admin_enqueue_scripts', 'educational_blocks_enqueue_admin_script');
    99 // Reset the dismissed notice status when the theme is switched
    100 function educational_blocks_after_switch_theme() {
    101     delete_user_meta(get_current_user_id(), 'dismissed_admin_notice');
    102 }
    103 add_action('after_switch_theme', 'educational_blocks_after_switch_theme');
     128
    104129//get-start-function-end//
    105130
  • educational-blocks/1.8/inc/customizer/customizer.css

    r229638 r237640  
    11/*Cutomizer CSS*/
    22#accordion-section-educational_blocks_pro h3.accordion-section-title{
    3   background: var(--wp--preset--color--primary);
     3  background: #ffbd0a;
    44    color:#fff;
    55}
    66#customize-controls #accordion-section-educational_blocks_pro .accordion-section-title:focus, #customize-controls #accordion-section-educational_blocks_pro .accordion-section-title:hover, #customize-controls #accordion-section-educational_blocks_pro.open .accordion-section-title, #customize-controls #accordion-section-educational_blocks_pro:hover>.accordion-section-title{
    7   background: var(--wp--preset--color--primary);
     7  background: #ffbd0a;
    88  color: #fff;
    99}
     
    1313
    1414#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section .accordion-section-title:focus{
    15   border-left-color:var(--wp--preset--color--primary);
     15  border-left-color:#ffbd0a;
    1616}
    1717.btn-lg, .btn-group-lg > .btn {
     
    2323.upsell-btn > .btn-success {
    2424  color: #fff;
    25   background: var(--wp--preset--color--primary);
     25  background: #ffbd0a;
    2626  text-decoration: none;
    2727}
  • educational-blocks/1.8/inc/customizer/customizer.php

    r231826 r237640  
    1313    // Pro Section
    1414    $wp_customize->add_section('educational_blocks_pro', array(
    15         'title'    => __('EDUCATIONAL BLOCKS PREMIUM ', 'educational-blocks'),
     15        'title'    => __('EDUCATION PREMIUM ', 'educational-blocks'),
    1616        'priority' => 1,
    1717    ));
     
    2121    ));
    2222    $wp_customize->add_control(new Educational_Blocks_Pro_Control($wp_customize, 'educational_blocks_pro', array(
    23         'label'    => __('EDUCATIONAL BLOCKS PREMIUM', 'educational-blocks'),
     23        'label'    => __('EDUCATION PREMIUM', 'educational-blocks'),
    2424        'section'  => 'educational_blocks_pro',
    2525        'settings' => 'educational_blocks_pro',
     
    3939        <label style="overflow: hidden; zoom: 1;">
    4040            <div class="col-md upsell-btn">
    41                 <a href="<?php echo esc_url( EDUCATIONAL_BLOCKS_PRO_LINK ); ?>" target="blank" class="btn btn-success btn"><?php esc_html_e('UPGRADE EDUCATIONAL BLOCKS PREMIUM ','educational-blocks');?> </a>
     41                <a href="<?php echo esc_url( EDUCATIONAL_BLOCKS_PRO_LINK ); ?>" target="blank" class="btn btn-success btn"><?php esc_html_e('UPGRADE EDUCATION PREMIUM ','educational-blocks');?> </a>
    4242            </div>
    4343            <div class="col-md">
     
    6363            </div>
    6464            <div class="col-md upsell-btn upsell-btn-bottom">
    65                 <a href="<?php echo esc_url( EDUCATIONAL_BLOCKS_PRO_LINK ); ?>" target="blank" class="btn btn-success btn"><?php esc_html_e('UPGRADE EDUCATIONAL BLOCKS PREMIUM ','educational-blocks');?> </a>
     65                <a href="<?php echo esc_url( EDUCATIONAL_BLOCKS_PRO_LINK ); ?>" target="blank" class="btn btn-success btn"><?php esc_html_e('UPGRADE EDUCATION PREMIUM ','educational-blocks');?> </a>
    6666            </div>
    6767        </label>
  • educational-blocks/1.8/inc/dashboard/admin.js

    r221978 r237640  
    1 jQuery(document).ready(function($) {
    2 $('.notice.is-dismissible').on('click', '.notice-dismiss', function () {
    3     $.ajax({
    4             type: 'POST',
    5             url: ajaxurl,
    6             data: {
    7                 action: 'educational_blocks_dismiss_admin_notice',
    8             },
    9         });
    10     });
    11 });
     1( function( jQuery ){
     2 jQuery( document ).on( 'click', '.notice-info .notice-dismiss', function () {
     3        var type = jQuery( this ).closest( '.notice-info' ).data( 'notice' );
     4        jQuery.ajax( ajaxurl,
     5          {
     6            type: 'POST',
     7            data: {
     8              action: 'educational_blocks_dismissed_notice_handler',
     9              type: type,
     10              wpnonce: educational_blocks.wpnonce
     11            }
     12          } );
     13      } );
     14}( jQuery ) )
  • educational-blocks/1.8/inc/dashboard/dashboard.css

    r220660 r237640  
    4040    text-align: right;
    4141}
    42 .wrap.getting-started .buynow {
     42.wrap.getting-started .buynow,.notice-buttons-box .buynow {
    4343    background: #28a745;
    4444    border-color: #28a745;
    4545}
    46 .wrap.getting-started .livedemo {
     46.wrap.getting-started .livedemo,.notice-buttons-box .livedemo {
    4747    background: #d39e00;
    4848    border-color: #d39e00;
    4949}
    50 .wrap.getting-started .docs {
     50.wrap.getting-started .docs,.notice-buttons-box .theme-install {
    5151    background: #bd2130;
    5252    border-color: #bd2130;
     
    6969}
    7070.notice-div .button-primary{
    71     padding: 5px 10px;
     71    padding: 3px 15px;
    7272}
     73
     74.notice-buttons-box{
     75    display: flex;
     76    justify-content: right;
     77    align-items: center;
     78}
     79.notice-buttons-box .livedemo,
     80.notice-buttons-box .buynow{
     81    margin-right: 10px;
     82}
     83
     84@media screen and (max-width:600px){
     85    .notice-div,.notice-buttons-box{
     86        display: block;
     87        text-align: center;
     88    }
     89    .notice-buttons-box .theme-install{
     90        margin-top: 10px;
     91    }
     92}
  • educational-blocks/1.8/inc/dashboard/dashboard.php

    r231826 r237640  
    33add_action( 'admin_menu', 'educational_blocks_gettingstarted' );
    44function educational_blocks_gettingstarted() {
    5     add_theme_page( esc_html__('Theme Documentation', 'educational-blocks'), esc_html__('Theme Documentation', 'educational-blocks'), 'edit_theme_options', 'educational-blocks-guide-page', 'educational_blocks_guide');
     5    add_theme_page( esc_html__('Theme Installation', 'educational-blocks'), esc_html__('Theme Installation', 'educational-blocks'), 'edit_theme_options', 'educational-blocks-guide-page', 'educational_blocks_guide');
    66}
    77
  • educational-blocks/1.8/readme.txt

    r235539 r237640  
    33Contributors: pewilliams
    44Requires at least: 6.1
    5 Tested up to: 6.5
     5Tested up to: 6.6
    66Requires PHP: 5.6
    7 Stable tag: 1.7
     7Stable tag: 1.8
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    189189* Added woocommerce css.
    190190* Blog template css.
     191
     192= 1.8 =
     193* Updated admin.js file.
     194* Added nonce.
     195* Updated Notice function.
     196* Added search page css.
  • educational-blocks/1.8/style.css

    r235539 r237640  
    66Description: Educational Blocks is a tailored solution crafted especially for educators, schools, and educational institutions, prioritizing simplicity and accessibility in the digital realm. This theme stands out for its clean and intuitive design, providing a user-friendly platform that empowers educators to showcase educational content without the need for technical expertise. Central to the theme's appeal is its responsiveness, ensuring optimal viewing on diverse devices, ranging from desktops to tablets and smartphones. This adaptability guarantees accessibility for a broad audience, fostering an inclusive online learning environment. It is also cross-browser compatible, allowing your users to visit your website through the web browser of their choice and comfort. A notable feature of the Educational Blocks WordPress Theme is its robust customization options, allowing users to effortlessly personalize their websites. Whether highlighting courses, faculty profiles, or school events, the theme offers flexibility to create a unique and engaging online space that aligns seamlessly with the educational institution's identity. Practical functionalities include dedicated sections for course listings, events, and contact details, enhancing the overall user experience. While the theme emphasizes simplicity, it provides a valuable tool for educators seeking a professional online presence. Whether establishing connections with students or sharing educational content effectively, the Educational Blocks WordPress Theme serves as a foundational and accessible solution in the ever-evolving landscape of digital education.
    77Requires at least: 6.1
    8 Tested up to: 6.5
     8Tested up to: 6.6
    99Requires PHP: 5.6
    10 Version: 1.7
     10Version: 1.8
    1111License: GNU General Public License
    1212License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    652652@media screen and (max-width: 999px) and (min-width: 782px){
    653653    .page-template-blog-right-sidebar .wp-block-post-template,
    654     .page-template-blog-left-sidebar .wp-block-post-template{
     654    .page-template-blog-left-sidebar .wp-block-post-template,
     655    .search-results .wp-block-post-template{
    655656        grid-template-columns: 1fr !important;
    656657    }
     
    680681    .page-template-blog-right-sidebar .wp-block-post-template,
    681682    .page-template-blog-left-sidebar .wp-block-post-template,
    682     .blog-section .wp-block-post-template{
     683    .blog-section .wp-block-post-template,
     684    .search-results .wp-block-post-template{
    683685        display: block !important;
    684686    }
     
    686688    .page-template-blog-right-sidebar .wp-block-post-template li,
    687689    .page-template-blog-left-sidebar .wp-block-post-template li,
    688     .blog-section .wp-block-post-template li{
     690    .blog-section .wp-block-post-template li,
     691    .search-results .wp-block-post-template li{
    689692        margin-bottom: 30px;
    690693    }
     
    692695    .page-template-blog-right-sidebar .wp-block-post-template li:last-child,
    693696    .page-template-blog-left-sidebar .wp-block-post-template li:last-child,
    694     .blog-section .wp-block-post-template li:last-child{
     697    .blog-section .wp-block-post-template li:last-child,
     698    .search-results .wp-block-post-template li:last-child{
    695699        margin-bottom: 0;
    696700    }
Note: See TracChangeset for help on using the changeset viewer.