Make WordPress Themes

Changeset 342277


Ignore:
Timestamp:
08/05/2026 12:01:06 PM (3 months ago)
Author:
themedropbox
Message:

New version of Linnea - 1.1.0

Location:
linnea/1.1.0
Files:
5 added
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • linnea/1.1.0/functions.php

    r333571 r342277  
    7070}
    7171add_action( 'init', 'linnea_register_pattern_categories' );
     72
     73/**
     74 * Dismissible welcome notice in the admin.
     75 */
     76function linnea_setup_notice() {
     77        if ( ! current_user_can( 'edit_theme_options' ) || get_option( 'linnea_setup_notice_dismissed' ) ) {
     78                return;
     79        }
     80
     81        $notice_text = '<div class="linnea-notice-text">
     82                <p class="linnea-notice-kicker">' . __( 'Elfia Themes', 'linnea' ) . '</p>
     83                <h3>' . __( 'Thank you for choosing Linnea!', 'linnea' ) . '</h3>
     84                <p>' . __( 'Linnea PRO adds 4 homepage designs, an editorial post template, 9 post patterns, and 6 color styles including dark Noir.', 'linnea' ) . '</p>
     85                <p class="linnea-notice-cta">
     86                        <a href="https://elfiathemes.com/product/linnea-pro/?utm_source=linnea-theme" target="_blank" rel="noopener">' . __( 'Discover Linnea PRO', 'linnea' ) . '</a>
     87                </p>
     88                <p class="linnea-notice-links">🌐 <a href="https://elfiathemes.com" target="_blank" rel="noopener">elfiathemes.com</a> &nbsp;·&nbsp; 💌 <a href="mailto:hello@elfiathemes.com">hello@elfiathemes.com</a></p>
     89                <p class="linnea-notice-dismiss-hint">' . __( 'Close this notice to hide it forever.', 'linnea' ) . '</p>
     90        </div>';
     91
     92        echo '<div id="linnea-notice" class="notice is-dismissible">' . wp_kses_post( $notice_text ) . '</div>';
     93}
     94add_action( 'admin_notices', 'linnea_setup_notice' );
     95
     96/**
     97 * Notice assets (only while the notice is visible).
     98 */
     99function linnea_notice_assets() {
     100        if ( ! current_user_can( 'edit_theme_options' ) || get_option( 'linnea_setup_notice_dismissed' ) ) {
     101                return;
     102        }
     103
     104        wp_enqueue_style( 'linnea-admin-notice', get_template_directory_uri() . '/assets/css/admin-notice.css', array(), wp_get_theme()->get( 'Version' ) );
     105        wp_enqueue_script( 'linnea-notice-script', get_template_directory_uri() . '/assets/js/admin-notice.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ), true );
     106        wp_localize_script( 'linnea-notice-script', 'linneaNotice', array(
     107                'nonce' => wp_create_nonce( 'linnea_dismiss_notice' ),
     108        ) );
     109}
     110add_action( 'admin_enqueue_scripts', 'linnea_notice_assets' );
     111
     112/**
     113 * AJAX: remember that the notice was dismissed.
     114 */
     115function linnea_dismiss_notice() {
     116        check_ajax_referer( 'linnea_dismiss_notice' );
     117        if ( ! current_user_can( 'edit_theme_options' ) ) {
     118                wp_die();
     119        }
     120        update_option( 'linnea_setup_notice_dismissed', true );
     121        wp_die();
     122}
     123add_action( 'wp_ajax_linnea_dismiss_notice', 'linnea_dismiss_notice' );
     124
     125/**
     126 * "About Linnea" page under Appearance.
     127 */
     128function linnea_add_about_page() {
     129        add_theme_page(
     130                __( 'About Linnea', 'linnea' ),
     131                __( 'About Linnea', 'linnea' ),
     132                'edit_theme_options',
     133                'linnea-about',
     134                'linnea_about_page_html'
     135        );
     136}
     137add_action( 'admin_menu', 'linnea_add_about_page' );
     138
     139function linnea_about_page_styles( $hook ) {
     140        if ( 'appearance_page_linnea-about' !== $hook ) {
     141                return;
     142        }
     143        wp_enqueue_style( 'linnea-about-page', get_template_directory_uri() . '/assets/css/admin-about.css', array(), wp_get_theme()->get( 'Version' ) );
     144}
     145add_action( 'admin_enqueue_scripts', 'linnea_about_page_styles' );
     146
     147function linnea_about_page_html() {
     148        $theme   = wp_get_theme();
     149        $version = $theme->get( 'Version' );
     150        ?>
     151        <div class="wrap linnea-about-wrap">
     152                <p class="linnea-about-kicker"><?php esc_html_e( 'Elfia Themes', 'linnea' ); ?></p>
     153                <h1><?php esc_html_e( 'Linnea', 'linnea' ); ?> <span class="linnea-version"><?php echo esc_html( $version ); ?></span></h1>
     154
     155                <div class="linnea-about-pro-hero">
     156                        <p class="linnea-about-pro-kicker"><?php esc_html_e( 'Premium Edition', 'linnea' ); ?></p>
     157                        <h2><?php esc_html_e( 'Linnea PRO', 'linnea' ); ?></h2>
     158                        <p class="linnea-about-pro-intro"><?php esc_html_e( 'Everything in Linnea — and the whole wardrobe to go with it.', 'linnea' ); ?></p>
     159                        <ul class="linnea-about-pro-features">
     160                                <li><?php esc_html_e( '4 homepage designs — Classic, Magazine, Editorial, Grid Gallery', 'linnea' ); ?></li>
     161                                <li><?php esc_html_e( 'Single — Editorial post template', 'linnea' ); ?></li>
     162                                <li><?php esc_html_e( 'Archive — List Layout pattern', 'linnea' ); ?></li>
     163                                <li><?php esc_html_e( '9 post patterns + a ready-made demo article', 'linnea' ); ?></li>
     164                                <li><?php esc_html_e( '6 color styles, including the dark Noir palette', 'linnea' ); ?></li>
     165                                <li><?php esc_html_e( 'Automatic updates with your license', 'linnea' ); ?></li>
     166                        </ul>
     167                        <a href="https://elfiathemes.com/product/linnea-pro/?utm_source=linnea-theme-about" class="linnea-about-btn linnea-about-btn-light" target="_blank" rel="noopener">
     168                                <?php esc_html_e( 'Discover Linnea PRO', 'linnea' ); ?>
     169                        </a>
     170                </div>
     171
     172                <div class="linnea-about-columns">
     173                        <div class="linnea-about-card linnea-about-author">
     174                                <h2><?php esc_html_e( 'Elfia Themes', 'linnea' ); ?></h2>
     175                                <p><?php esc_html_e( 'Elegant, feminine themes for bloggers. Designed by Anastasi.', 'linnea' ); ?></p>
     176                                <ul class="linnea-about-links">
     177                                        <li>🌐 <a href="https://elfiathemes.com" target="_blank" rel="noopener">elfiathemes.com</a></li>
     178                                        <li>💌 <a href="mailto:hello@elfiathemes.com">hello@elfiathemes.com</a></li>
     179                                </ul>
     180                        </div>
     181
     182                        <div class="linnea-about-card linnea-about-help">
     183                                <h2><?php esc_html_e( 'Need a hand?', 'linnea' ); ?></h2>
     184                                <p><?php esc_html_e( 'Questions about the theme? Write me.', 'linnea' ); ?></p>
     185                                <p><a href="mailto:hello@elfiathemes.com"><strong>hello@elfiathemes.com</strong></a></p>
     186                        </div>
     187                </div>
     188        </div>
     189        <?php
     190}
  • linnea/1.1.0/readme.txt

    r333571 r342277  
    66Tested up to: 7.0
    77Requires PHP: 7.4
    8 Stable tag: 1.0.0
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    6767== Changelog ==
    6868
     69= 1.1.0 =
     70* Added "About Linnea" page under Appearance.
     71* Added dismissible welcome notice in the admin.
     72
    6973= 1.0.0 =
    7074* Initial release.
  • linnea/1.1.0/style.css

    r333571 r342277  
    77Tested up to: 7.0
    88Requires PHP: 7.4
    9 Version: 1.0.0
     9Version: 1.1.0
    1010License: GNU General Public License v2 or later
    1111License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.