shell bypass 403

GrazzMean-Shell Shell

Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : template-functions.php
<?php

if (!function_exists('motiox_display_comments')) {
    /**
     * Motiox display comments
     *
     * @since  1.0.0
     */
    function motiox_display_comments() {
        // If comments are open or we have at least one comment, load up the comment template.
        if (comments_open() || 0 !== intval(get_comments_number())) :
            comments_template();
        endif;
    }
}

if (!function_exists('motiox_comment')) {
    /**
     * Motiox comment template
     *
     * @param array $comment the comment array.
     * @param array $args the comment args.
     * @param int $depth the comment depth.
     *
     * @since 1.0.0
     */
    function motiox_comment($comment, $args, $depth) {
        if ('div' === $args['style']) {
            $tag       = 'div';
            $add_below = 'comment';
        } else {
            $tag       = 'li';
            $add_below = 'div-comment';
        }
        ?>
        <<?php echo esc_attr($tag) . ' '; ?><?php comment_class(empty($args['has_children']) ? '' : 'parent'); ?> id="comment-<?php comment_ID(); ?>">

        <div class="comment-body">
            <div class="comment-author vcard">
                <?php echo get_avatar($comment, 50); ?>
            </div>
            <?php if ('div' !== $args['style']) : ?>
            <div id="div-comment-<?php comment_ID(); ?>" class="comment-content">
                <?php endif; ?>
                <div class="comment-head">
                    <div class="comment-meta commentmetadata">
                        <?php printf('<cite class="fn">%s</cite>', get_comment_author_link()); ?>

                        <?php
                        printf(
                            '<a href="%s" class="comment-date"><time datetime="%s">%s</time></a>',
                            esc_url(get_comment_link($comment, $args)),
                            get_comment_time('c'),
                            sprintf(
                            /* translators: 1: Comment date, 2: Comment time. */
                                __('%1$s', 'motiox'),
                                get_comment_date('d M Y', $comment)
                            )
                        );

                        ?>

                        <?php if ('0' === $comment->comment_approved) : ?>
                            <em class="comment-awaiting-moderation"><?php esc_html_e('Your comment is awaiting moderation.', 'motiox'); ?></em>
                            <br/>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="comment-text">
                    <?php comment_text(); ?>
                </div>

                <div class="reply">
                    <?php
                    comment_reply_link(
                        array_merge(
                            $args, array(
                                'add_below' => $add_below,
                                'depth'     => $depth,
                                'max_depth' => $args['max_depth'],
                            )
                        )
                    );
                    ?>
                    <?php edit_comment_link(esc_html__('Edit', 'motiox'), '  ', ''); ?>
                </div>
                <?php if ('div' !== $args['style']) : ?>
            </div>
        <?php endif; ?>
        </div>
        <?php
    }
}

if (!function_exists('motiox_archive_blog_top')) {
    function motiox_archive_blog_top() {
        if (is_home() || is_category()) {
            $show_top_blog = motiox_get_theme_option('show_top_blog');
            if ($show_top_blog === 'yes') {
                $slug         = motiox_get_theme_option('top_blog_template');
                $queried_post = get_page_by_path($slug, OBJECT, 'elementor_library');
                if (isset($queried_post->ID)) {
                    echo Elementor\Plugin::instance()->frontend->get_builder_content_for_display($queried_post->ID);
                    $css_file = Elementor\Core\Files\CSS\Post::create($queried_post->ID);
                    $css_file->enqueue();
                }
            }
        }
    }
}

if (!function_exists('motiox_credit')) {
    /**
     * Display the theme credit
     *
     * @return void
     * @since  1.0.0
     */
    function motiox_credit() {
        ?>
        <div class="site-info">
            <?php echo apply_filters('motiox_copyright_text', $content = '&copy; ' . date('Y') . ' ' . '<a class="site-url" href="' . esc_url(site_url()) . '">' . esc_html(get_bloginfo('name')) . '</a>' . esc_html__('. All Rights Reserved.', 'motiox')); ?>
        </div><!-- .site-info -->
        <?php
    }
}

if (!function_exists('motiox_social')) {
    function motiox_social() {
        $social_list = motiox_get_theme_option('social_text', []);
        if (empty($social_list)) {
            return;
        }
        ?>
        <div class="motiox-social">
            <ul>
                <?php

                foreach ($social_list as $social_item) {
                    ?>
                    <li><a href="<?php echo esc_url($social_item); ?>"></a></li>
                    <?php
                }
                ?>

            </ul>
        </div>
        <?php
    }
}

if (!function_exists('motiox_site_branding')) {
    /**
     * Site branding wrapper and display
     *
     * @return void
     * @since  1.0.0
     */
    function motiox_site_branding() {
        ?>
        <div class="site-branding">
            <?php echo motiox_site_title_or_logo(); ?>
        </div>
        <?php
    }
}

if (!function_exists('motiox_site_title_or_logo')) {
    /**
     * Display the site title or logo
     *
     * @param bool $echo Echo the string or return it.
     *
     * @return string
     * @since 2.1.0
     */
    function motiox_site_title_or_logo() {
        ob_start();
        the_custom_logo(); ?>
        <div class="site-branding-text">
            <?php if (is_front_page()) : ?>
                <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"
                                          rel="home"><?php bloginfo('name'); ?></a></h1>
            <?php else : ?>
                <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"
                                         rel="home"><?php bloginfo('name'); ?></a></p>
            <?php endif; ?>

            <?php
            $description = get_bloginfo('description', 'display');

            if ($description || is_customize_preview()) :
                ?>
                <p class="site-description"><?php echo esc_html($description); ?></p>
            <?php endif; ?>
        </div><!-- .site-branding-text -->
        <?php
        $html = ob_get_clean();
        return $html;
    }
}

if (!function_exists('motiox_primary_navigation')) {
    /**
     * Display Primary Navigation
     *
     * @return void
     * @since  1.0.0
     */
    function motiox_primary_navigation() {
        ?>
        <nav class="main-navigation" role="navigation"
             aria-label="<?php esc_attr_e('Primary Navigation', 'motiox'); ?>">
            <?php
            wp_nav_menu(apply_filters('motiox_nav_menu_args', [
                'fallback_cb'     => '__return_empty_string',
                'theme_location'  => 'primary',
                'container_class' => 'primary-navigation',
                'link_before'     => '<span class="menu-title">',
                'link_after'      => '</span>'
            ]));
            ?>
        </nav>
        <?php
    }
}

if (!function_exists('motiox_mobile_navigation')) {
    /**
     * Display Handheld Navigation
     *
     * @return void
     * @since  1.0.0
     */
    function motiox_mobile_navigation() {
        if (isset(get_nav_menu_locations()['handheld']) || isset(get_nav_menu_locations()['vertical'])): ?>
            <div class="mobile-nav-tabs">
                <ul>
                    <?php if (isset(get_nav_menu_locations()['handheld'])): ?>
                        <li class="mobile-tab-title mobile-pages-title active" data-menu="pages">
                            <span><?php echo esc_html(get_term(get_nav_menu_locations()['handheld'], 'nav_menu')->name); ?></span>
                        </li>
                    <?php endif; ?>
                    <?php if (isset(get_nav_menu_locations()['vertical'])) : ?>
                        <li class="mobile-tab-title mobile-categories-title" data-menu="categories">
                            <span><?php echo esc_html(get_term(get_nav_menu_locations()['vertical'], 'nav_menu')->name); ?></span>
                        </li>
                    <?php endif; ?>
                </ul>
            </div>
            <?php if (isset(get_nav_menu_locations()['handheld'])): ?>
                <nav class="mobile-menu-tab mobile-navigation mobile-pages-menu active"
                     aria-label="<?php esc_attr_e('Mobile Navigation', 'motiox'); ?>">
                    <?php
                    wp_nav_menu(
                        array(
                            'theme_location'  => 'handheld',
                            'container_class' => 'handheld-navigation',
                        )
                    );
                    ?>
                </nav>
            <?php endif; ?>
            <?php if (isset(get_nav_menu_locations()['vertical'])): ?>
                <nav class="mobile-menu-tab mobile-navigation-categories mobile-categories-menu"
                     aria-label="<?php esc_attr_e('Mobile Navigation', 'motiox'); ?>">
                    <?php
                    wp_nav_menu(
                        array(
                            'theme_location'  => 'vertical',
                            'container_class' => 'handheld-navigation',
                        )
                    );
                    ?>
                </nav>
            <?php endif; ?>
        <?php endif; ?>
        <?php
    }
}

if (!function_exists('motiox_homepage_header')) {
    /**
     * Display the page header without the featured image
     *
     * @since 1.0.0
     */
    function motiox_homepage_header() {
        edit_post_link(esc_html__('Edit this section', 'motiox'), '', '', '', 'button motiox-hero__button-edit');
        ?>
        <header class="entry-header">
            <?php
            the_title('<h1 class="entry-title">', '</h1>');
            ?>
        </header><!-- .entry-header -->
        <?php
    }
}

if (!function_exists('motiox_page_header')) {
    /**
     * Display the page header
     *
     * @since 1.0.0
     */
    function motiox_page_header() {

        if (is_front_page() || !is_page_template('default')) {
            return;
        }

        ?>
        <header class="entry-header">
            <?php
            if (has_post_thumbnail()) {
                motiox_post_thumbnail('full');
            }
            the_title('<h1 class="entry-title">', '</h1>');
            ?>
        </header><!-- .entry-header -->
        <?php
    }
}

if (!function_exists('motiox_page_content')) {
    /**
     * Display the post content
     *
     * @since 1.0.0
     */
    function motiox_page_content() {
        ?>
        <div class="entry-content">
            <?php the_content(); ?>
            <?php
            wp_link_pages(
                array(
                    'before' => '<div class="page-links">' . esc_html__('Pages:', 'motiox'),
                    'after'  => '</div>',
                )
            );
            ?>
        </div><!-- .entry-content -->
        <?php
    }
}

if (!function_exists('motiox_post_header')) {
    /**
     * Display the post header with a link to the single post
     *
     * @since 1.0.0
     */
    function motiox_post_header() {
        ?>
        <header class="entry-header">
            <?php
            if (is_single()) { ?>
                <div class="entry-meta">
                    <?php motiox_post_meta(['show_cat' => true, 'show_author' => false, 'show_date' => false, 'show_comment' => false]); ?>
                </div>
                <?php the_title('<h1 class="entry-title">', '</h1>'); ?>
                <div class="entry-meta">
                    <div class="entry-author">
                        <img class="img-author" src="<?php echo esc_url(get_avatar_url(get_the_author_meta('ID'))); ?>" alt=""/>
                        <?php motiox_post_meta(['show_cat' => false, 'show_author' => true, 'show_date' => true, 'show_comment' => false]); ?>
                    </div>
                </div>
                <?php
            } else { ?>
                <div class="header-meta">
                    <?php motiox_post_meta(['show_cat' => true, 'show_author' => false, 'show_date' => false, 'show_comment' => false]); ?>
                </div>
                <div class="entry-content">
                    <?php the_title('<h3 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h3>'); ?>
                    <div class="entry-excerpt"><?php echo wp_trim_words(get_the_excerpt(), 50); ?></div>
                    <div class="entry-meta">
                        <div class="entry-author">
                            <img class="img-author" src="<?php echo esc_url(get_avatar_url(get_the_author_meta('ID'))); ?>" alt=""/>
                            <?php motiox_post_meta(['show_cat' => false, 'show_author' => true, 'show_date' => false, 'show_comment' => false]); ?>
                        </div>
                        <?php motiox_post_meta(['show_cat' => false, 'show_author' => false, 'show_date' => true, 'show_comment' => false]); ?>
                    </div>
                </div>
            <?php } ?>
        </header><!-- .entry-header -->
        <?php
    }
}

if (!function_exists('motiox_post_content')) {
    /**
     * Display the post content with a link to the single post
     *
     * @since 1.0.0
     */
    function motiox_post_content() {
        ?>
        <div class="entry-content">
            <?php

            /**
             * Functions hooked in to motiox_post_content_before action.
             *
             */
            do_action('motiox_post_content_before');


            if (is_single()) {
                the_content(
                    sprintf(
                    /* translators: %s: post title */
                        esc_html__('Read More', 'motiox') . ' %s',
                        '<span class="screen-reader-text">' . get_the_title() . '</span>'
                    )
                );
            }

            /**
             * Functions hooked in to motiox_post_content_after action.
             *
             */
            do_action('motiox_post_content_after');

            wp_link_pages(
                array(
                    'before' => '<div class="page-links">' . esc_html__('Pages:', 'motiox'),
                    'after'  => '</div>',
                )
            );
            ?>
        </div><!-- .entry-content -->
        <?php
    }
}

if (!function_exists('motiox_post_meta')) {
    /**
     * Display the post meta
     *
     * @since 1.0.0
     */
    function motiox_post_meta($atts = array()) {
        global $post;
        if ('post' !== get_post_type()) {
            return;
        }

        extract(
            shortcode_atts(
                array(
                    'show_date'    => true,
                    'format'       => 'full',
                    'show_cat'     => true,
                    'show_author'  => true,
                    'show_comment' => true,
                ),
                $atts
            )
        );

        $categories_list = get_the_category_list('');
        $categories      = '';
        if ($show_cat && $categories_list) {
            // Make sure there's more than one category before displaying.
            $categories = '<div class="categories-link">
                            <span class="screen-reader-text">' . esc_html__('Categories', 'motiox') . '
                            </span>' . $categories_list . '</div>';
        }

        $author = '';
        // Author.
        if ($show_author == 1) {
            $author_id = $post->post_author;
            $author    = sprintf(
                '<div class="post-author">By <span>
                            <a href="%1$s" class="url fn" rel="author">%2$s</a>
                            <a href="%1$s" class="link-hover" rel="author">%2$s</a>
                            </span>
                        </div>',
                esc_url(get_author_posts_url(get_the_author_meta('ID'))),
                esc_html(get_the_author_meta('display_name', $author_id))
            );
        }

        $posted_on = '';
        // Posted on.
        if ($show_date) {
            if (!empty($format) && $format == 'full') {
                $posted_on = '<div class="posted-on">Date '
                             . sprintf(' <span><a href="%1$s" class="date fn"  rel="bookmark">%2$s</a> <a href="%1$s" class="link-hover"  rel="bookmark">%2$s</a></span>', esc_url(get_permalink()), get_the_date('F d, Y')) .
                             '</div>';
            } else {
                $posted_on = '<div class="posted-on">'
                             . sprintf('<a href="%1$s" class="date fn" rel="bookmark">%2$s</a>', esc_url(get_permalink()), get_the_date('d M Y')) .
                             '</div>';
            }

        }
        echo wp_kses(
            sprintf('%1$s  %2$s %3$s', $categories, $posted_on, $author), array(
                'div'  => array(
                    'class' => array(),
                ),
                'span' => array(
                    'class' => array(),
                ),
                'a'    => array(
                    'href'  => array(),
                    'rel'   => array(),
                    'class' => array(),
                    'style' => array(),
                ),
                'time' => array(
                    'datetime' => array(),
                    'class'    => array(),
                )
            )
        );

        if ($show_comment) { ?>
            <div class="meta-reply">
                <?php
                comments_popup_link(esc_html__('comments (0)', 'motiox'), esc_html__('comment (1)', 'motiox'), esc_html__('comments (%)', 'motiox'));
                ?>
            </div>
            <?php
        }

    }
}

if (!function_exists('motiox_get_allowed_html')) {
    function motiox_get_allowed_html() {
        return apply_filters(
            'motiox_allowed_html',
            array(
                'br'     => array(),
                'i'      => array(),
                'b'      => array(),
                'u'      => array(),
                'em'     => array(),
                'del'    => array(),
                'a'      => array(
                    'href'  => true,
                    'class' => true,
                    'title' => true,
                    'rel'   => true,
                ),
                'strong' => array(),
                'span'   => array(
                    'style' => true,
                    'class' => true,
                ),
            )
        );
    }
}

if (!function_exists('motiox_edit_post_link')) {
    /**
     * Display the edit link
     *
     * @since 2.5.0
     */
    function motiox_edit_post_link() {
        edit_post_link(
            sprintf(
                wp_kses(__('Edit <span class="screen-reader-text">%s</span>', 'motiox'),
                    array(
                        'span' => array(
                            'class' => array(),
                        ),
                    )
                ),
                get_the_title()
            ),
            '<div class="edit-link">',
            '</div>'
        );
    }
}

if (!function_exists('motiox_categories_link')) {
    /**
     * Prints HTML with meta information for the current cateogries
     */
    function motiox_categories_link() {

        // Get Categories for posts.
        $categories_list = get_the_category_list('');

        if ('post' === get_post_type() && $categories_list) {
            // Make sure there's more than one category before displaying.
            echo '<div class="categories-link"><span class="screen-reader-text">' . esc_html__('Categories', 'motiox') . '</span>' . $categories_list . '</div>';
        }
    }
}

if (!function_exists('motiox_post_taxonomy')) {
    /**
     * Display the post taxonomies
     *
     * @since 2.4.0
     */
    function motiox_post_taxonomy() {
        /* translators: used between list items, there is a space after the comma */

        /* translators: used between list items, there is a space after the comma */
        $tags_list = get_the_tag_list('', ' ');
        ?>
        <aside class="entry-taxonomy">
            <?php if ($tags_list) : ?>
                <div class="tags-links">
                    <span><?php echo esc_html(_n('Tag:', 'Tags:', count(get_the_tags()), 'motiox')); ?></span>
                    <?php printf('%s', $tags_list); ?>
                </div>
            <?php endif; ?>
        </aside>
        <?php
    }
}

if (!function_exists('motiox_paging_nav')) {
    /**
     * Display navigation to next/previous set of posts when applicable.
     */
    function motiox_paging_nav() {
        global $wp_query;

        $args = array(
            'type'      => 'list',
            'next_text' => '<i class="motiox-icon motiox-icon-arrow-right-yy"></i>',
            'prev_text' => '<i class="motiox-icon motiox-icon-arrow-left-yy"></i>',
        );

        the_posts_pagination($args);
    }
}

if (!function_exists('motiox_post_nav')) {
    /**
     * Display navigation to next/previous post when applicable.
     */
    function motiox_post_nav() {

        $prev_post      = get_previous_post();
        $next_post      = get_next_post();
        $args           = [];
        $thumbnail_prev = '';
        $thumbnail_next = '';

        if ($prev_post) {
            $thumbnail_prev = get_the_post_thumbnail($prev_post->ID, array(60, 60));
        };

        if ($next_post) {
            $thumbnail_next = get_the_post_thumbnail($next_post->ID, array(60, 60));
        };
        if ($next_post) {
            $args['next_text'] = '<span class="nav-content"><span class="reader-text">' . esc_html__('Next post', 'motiox') . ' </span><span class="title">%title</span></span>' . $thumbnail_next;
        }
        if ($prev_post) {
            $args['prev_text'] = $thumbnail_prev . '<span class="nav-content"><span class="reader-text">' . esc_html__('Previous post', 'motiox') . ' </span><span class="title">%title</span></span> ';
        }

        the_post_navigation($args);

    }
}

if (!function_exists('motiox_homepage_content')) {
    /**
     * Display homepage content
     * Hooked into the `homepage` action in the homepage template
     *
     * @return  void
     * @since  1.0.0
     */
    function motiox_homepage_content() {
        while (have_posts()) {
            the_post();

            get_template_part('content', 'homepage');

        } // end of the loop.
    }
}

if (!function_exists('motiox_get_sidebar')) {
    /**
     * Display motiox sidebar
     *
     * @uses get_sidebar()
     * @since 1.0.0
     */
    function motiox_get_sidebar() {
        get_sidebar();
    }
}

if (!function_exists('motiox_post_thumbnail')) {
    /**
     * Display post thumbnail
     *
     * @param string $size the post thumbnail size.
     *
     * @uses has_post_thumbnail()
     * @uses the_post_thumbnail
     * @var $size . thumbnail|medium|large|full|$custom
     * @since 1.5.0
     */
    function motiox_post_thumbnail($size = 'post-thumbnail', $showdate = false) {
        if (has_post_thumbnail()) :
            echo '<div class="post-thumbnail">';
            if ($showdate) { ?>
                <div class="entry-meta">
                    <?php
                    echo '<div class="posted-on">' . sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_permalink()), get_the_modified_date('d M Y')) . '</div>';
                    ?>
                </div>
            <?php }
            the_post_thumbnail($size ? $size : 'post-large');
            echo '</div>';
        endif;
    }
}

if (!function_exists('motiox_primary_navigation_wrapper')) {
    /**
     * The primary navigation wrapper
     */
    function motiox_primary_navigation_wrapper() {
        echo '<div class="motiox-primary-navigation"><div class="col-full">';
    }
}

if (!function_exists('motiox_primary_navigation_wrapper_close')) {
    /**
     * The primary navigation wrapper close
     */
    function motiox_primary_navigation_wrapper_close() {
        echo '</div></div>';
    }
}

if (!function_exists('motiox_header_container')) {
    /**
     * The header container
     */
    function motiox_header_container() {
        echo '<div class="col-full">';
    }
}

if (!function_exists('motiox_header_container_close')) {
    /**
     * The header container close
     */
    function motiox_header_container_close() {
        echo '</div>';
    }
}

if (!function_exists('motiox_header_custom_link')) {
    function motiox_header_custom_link() {
        echo motiox_get_theme_option('custom-link', '');
    }

}

if (!function_exists('motiox_header_contact_info')) {
    function motiox_header_contact_info() {
        echo motiox_get_theme_option('contact-info', '');
    }

}

if (!function_exists('motiox_header_account')) {
    function motiox_header_account() {

        if (!motiox_get_theme_option('show_header_account', true)) {
            return;
        }
        $account_link = wp_login_url();
        ?>
        <div class="site-header-account">
            <a href="<?php echo esc_url($account_link); ?>">
                <i class="motiox-icon-user-circle"></i>
                <span class="text-account">Log in / Sign up</span>
            </a>
            <div class="account-dropdown"></div>
        </div>
        <?php
    }
}

if (!function_exists('motiox_form_login')) {
    function motiox_form_login() {
        $register_link = wp_registration_url();
        ?>
        <div class="login-form-head">
            <span class="login-form-title"><?php esc_html_e('Sign in', 'motiox') ?></span>
            <span class="pull-right">
                <a class="register-link" href="<?php echo esc_url($register_link); ?>"
                   title="<?php esc_attr_e('Register', 'motiox'); ?>"><?php esc_html_e('Create an Account', 'motiox'); ?></a>
            </span>
        </div>
        <form class="motiox-login-form-ajax" data-toggle="validator">
            <p>
                <label><?php esc_html_e('Username or email', 'motiox'); ?> <span class="required">*</span></label>
                <input name="username" type="text" required placeholder="<?php esc_attr_e('Username', 'motiox') ?>">
            </p>
            <p>
                <label><?php esc_html_e('Password', 'motiox'); ?> <span class="required">*</span></label>
                <input name="password" type="password" required placeholder="<?php esc_attr_e('Password', 'motiox') ?>">
            </p>
            <button type="submit" data-button-action class="btn btn-primary btn-block w-100 mt-1"><?php esc_html_e('Login', 'motiox') ?></button>
            <input type="hidden" name="action" value="motiox_login">
            <?php wp_nonce_field('ajax-motiox-login-nonce', 'security-login'); ?>
        </form>
        <div class="login-form-bottom">
            <a href="<?php echo wp_lostpassword_url(get_permalink()); ?>" class="lostpass-link"
               title="<?php esc_attr_e('Lost your password?', 'motiox'); ?>"><?php esc_html_e('Lost your password?', 'motiox'); ?></a>
        </div>
        <?php
    }
}

if (!function_exists('motiox_template_account_dropdown')) {
    function motiox_template_account_dropdown() {
        if (!motiox_get_theme_option('show_header_account', true)) {
            return;
        }
        ?>
        <div class="account-wrap d-none">
            <div class="account-inner <?php if (is_user_logged_in()): echo "dashboard"; endif; ?>">
                <?php if (!is_user_logged_in()) {
                    motiox_form_login();
                } else {
                    motiox_account_dropdown();
                }
                ?>
            </div>
        </div>
        <?php
    }
}

if (!function_exists('motiox_account_dropdown')) {

    function motiox_account_dropdown() { ?>
        <?php if (has_nav_menu('my-account')) : ?>
            <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e('Dashboard', 'motiox'); ?>">
                <?php
                wp_nav_menu(array(
                    'theme_location' => 'my-account',
                    'menu_class'     => 'account-links-menu',
                    'depth'          => 1,
                ));
                ?>
            </nav><!-- .social-navigation -->
        <?php else: ?>
            <ul class="account-dashboard">

                <li>
                    <a href="<?php echo esc_url(get_dashboard_url(get_current_user_id())); ?>"
                       title="<?php esc_attr_e('Dashboard', 'motiox'); ?>"><?php esc_html_e('Dashboard', 'motiox'); ?></a>
                </li>
                <li>
                    <a title="<?php esc_attr_e('Log out', 'motiox'); ?>" class="tips"
                       href="<?php echo esc_url(wp_logout_url(home_url())); ?>"><?php esc_html_e('Log Out', 'motiox'); ?></a>
                </li>
            </ul>
        <?php endif;

    }
}


if (!function_exists('motiox_header_search_popup')) {
    function motiox_header_search_popup() {
        ?>
        <div class="site-search-popup">
            <div class="site-search-popup-wrap">
                <a href="#" class="site-search-popup-close">
                    <svg class="close-icon" xmlns="http://www.w3.org/2000/svg" width="23.691" height="22.723" viewBox="0 0 23.691 22.723">
                        <g transform="translate(-126.154 -143.139)">
                            <line x2="23" y2="22" transform="translate(126.5 143.5)" fill="none" stroke="CurrentColor" stroke-width="1"></line>
                            <path d="M0,22,23,0" transform="translate(126.5 143.5)" fill="none" stroke="CurrentColor" stroke-width="1"></path>
                        </g>
                    </svg>
                </a>
                <div class="site-search">
                    <?php get_search_form(); ?>
                </div>
            </div>
        </div>
        <div class="site-search-popup-overlay"></div>
        <?php
    }
}

if (!function_exists('motiox_header_search_button')) {
    function motiox_header_search_button() {

        add_action('wp_footer', 'motiox_header_search_popup', 1);
        ?>
        <div class="site-header-search">
            <a href="#" class="button-search-popup"><i class="motiox-icon-search-lg"></i></a>
        </div>
        <?php
    }
}


if (!function_exists('motiox_header_sticky')) {
    function motiox_header_sticky() {
        get_template_part('template-parts/header', 'sticky');
    }
}

if (!function_exists('motiox_mobile_nav')) {
    function motiox_mobile_nav() {
        if (isset(get_nav_menu_locations()['handheld'])) {
            ?>
            <div class="motiox-mobile-nav">
                <div class="menu-scroll-mobile">
                    <a href="#" class="mobile-nav-close"><i class="motiox-icon-times"></i></a>
                    <?php
                    motiox_mobile_navigation();
                    motiox_social();
                    ?>
                </div>
                <?php if (motiox_is_elementor_activated()) motiox_language_switcher_mobile(); ?>
            </div>
            <div class="motiox-overlay"></div>
            <?php
        }
    }
}

if (!function_exists('motiox_preload')) {
    function motiox_preload() {
        $status = motiox_get_theme_option('preload', 'yes');
        if ($status == 'yes') {
            $class[] = 'preload-' . esc_attr($status);
            $class   = esc_attr(implode(' ', array_unique($class)));
            ?>
            <div class="<?php echo esc_attr($class) ?>">
                <div id="loadingDiv">
                </div>
            </div>
            <?php
        }
    }
}

if (!function_exists('motiox_cursor')) {
    function motiox_cursor() {
        $status = motiox_get_theme_option('cursor', 'yes');
        if ($status == 'yes') {
            ?>
            <div class="cursor-yes">
                <div class="motiox-cursor"></div>
            </div>
            <?php
        }
    }
}

if (!function_exists('motiox_mobile_nav_button')) {
    function motiox_mobile_nav_button() {
        if (isset(get_nav_menu_locations()['handheld'])) {
            ?>
            <a href="#" class="menu-mobile-nav-button">
                <span class="toggle-text screen-reader-text"><?php echo apply_filters('motiox_menu_toggle_text', esc_html__('Menu', 'motiox')); ?></span>
                <div class="motiox-icon">
                    <span class="icon-1"></span>
                    <span class="icon-2"></span>
                    <span class="icon-3"></span>
                </div>
            </a>
            <?php
        }
    }
}

if (!function_exists('motiox_language_switcher')) {
    function motiox_language_switcher() {
        $languages = apply_filters('wpml_active_languages', []);
        if (motiox_is_wpml_activated() && count($languages) > 0) {
            ?>
            <div class="motiox-language-switcher">
                <ul class="menu">
                    <li class="item">
                        <div class="language-switcher-head">
                            <img src="<?php echo esc_url($languages[ICL_LANGUAGE_CODE]['country_flag_url']) ?>"
                                 alt="<?php esc_attr($languages[ICL_LANGUAGE_CODE]['default_locale']) ?>">
                            <span class="title"><?php echo esc_html($languages[ICL_LANGUAGE_CODE]['translated_name']); ?></span>
                            <i aria-hidden="true" class="motiox-icon-angle-down"></i>
                        </div>
                        <ul class="sub-item">
                            <?php
                            foreach ($languages as $key => $language) {
                                if (ICL_LANGUAGE_CODE === $key) {
                                    continue;
                                }
                                ?>
                                <li>
                                    <a href="<?php echo esc_url($language['url']) ?>">
                                        <img width="18" height="12"
                                             src="<?php echo esc_url($language['country_flag_url']) ?>"
                                             alt="<?php esc_attr($language['default_locale']) ?>">
                                        <span><?php echo esc_html($language['translated_name']); ?></span>
                                    </a>
                                </li>
                                <?php
                            }
                            ?>
                        </ul>
                    </li>
                </ul>
            </div>
            <?php
        }

    }
}

if (!function_exists('motiox_language_switcher_mobile')) {
    function motiox_language_switcher_mobile() {
        $languages = apply_filters('wpml_active_languages', []);
        if (motiox_is_wpml_activated() && count($languages) > 0) { ?>
            <div class="motiox-language-switcher-mobile">
                <ul class="menu">
                    <li class="item">
                        <div class="language-switcher-head">
                            <img src="<?php echo esc_url($languages[ICL_LANGUAGE_CODE]['country_flag_url']) ?>"
                                 alt="<?php esc_attr($languages[ICL_LANGUAGE_CODE]['default_locale']) ?>">
                        </div>
                    </li>
                    <?php foreach ($languages as $key => $language) {
                        if (ICL_LANGUAGE_CODE === $key) {
                            continue;
                        } ?>
                        <li class="item">
                            <div class="language-switcher-img">
                                <a href="<?php echo esc_url($language['url']) ?>">
                                    <img src="<?php echo esc_url($language['country_flag_url']) ?>"
                                         alt="<?php esc_attr($language['default_locale']) ?>">
                                </a>
                            </div>
                        </li>
                    <?php } ?>
                </ul>
            </div>
            <?php
        }
    }
}

if (!function_exists('motiox_update_comment_fields')) {
    function motiox_update_comment_fields($fields) {

        $commenter = wp_get_current_commenter();
        $req       = get_option('require_name_email');
        $aria_req  = $req ? "aria-required='true'" : '';

        $fields['author']
            = '<p class="comment-form-author">
			<input id="author" name="author" type="text" placeholder="' . esc_attr__('Name *', 'motiox') . '" value="' . esc_attr($commenter['comment_author']) .
              '" size="30" ' . $aria_req . ' />
		</p>';

        $fields['email']
            = '<p class="comment-form-email">
			<input id="email" name="email" type="email" placeholder="' . esc_attr__('Email *', 'motiox') . '" value="' . esc_attr($commenter['comment_author_email']) .
              '" size="30" ' . $aria_req . ' />
		</p>';

        $fields['url']
            = '<p class="comment-form-url">
			<input id="url" name="url" type="url"  placeholder="' . esc_attr__('Your Website', 'motiox') . '" value="' . esc_attr($commenter['comment_author_url']) .
              '" size="30" ' . $aria_req . ' />
			</p>';

        return $fields;
    }
}

add_filter('comment_form_default_fields', 'motiox_update_comment_fields');


function custom_comment_form_defaults($defaults) {
    $defaults['submit_button'] = '<button type="submit" id="%2$s" class="%3$s" value="%4$s"><span>%4$s</span></button>';
    return $defaults;
}

add_filter('comment_form_defaults', 'custom_comment_form_defaults');

function motiox_replace_categories_list($output, $args) {
    if ($args['show_count'] = 1) {
        $pattern     = '#<li([^>]*)><a([^>]*)>(.*?)<\/a>\s*\(([0-9]*)\)\s*#i';  // removed ( and )
        $replacement = '<li$1><a$2><span class="cat-name">$3</span> <span class="cat-count">($4)</span></a>';
        return preg_replace($pattern, $replacement, $output);
    }
    return $output;
}

add_filter('wp_list_categories', 'motiox_replace_categories_list', 10, 2);

function motiox_replace_archive_list($link_html, $url, $text, $format, $before, $after, $selected) {
    if ($format == 'html') {
        $pattern     = '#<li><a([^>]*)>(.*?)<\/a>&nbsp;\s*\(([0-9]*)\)\s*#i';  // removed ( and )
        $replacement = '<li><a$1><span class="archive-name">$2</span> <span class="archive-count">($3)</span></a>';
        return preg_replace($pattern, $replacement, $link_html);
    }
    return $link_html;
}

add_filter('get_archives_link', 'motiox_replace_archive_list', 10, 7);


add_action('wp_footer', 'motiox_render_html_back_to_top');
function motiox_render_html_back_to_top() {
    echo sprintf('<a href="#" class="scrollup"><span class="scrollup-icon motiox-icon-long-arrow-up"></span><span class="scrollup-label">%s</span></a>',
        esc_html__('Top', 'motiox'));

}

//add_filter('comment_form_default_fields', 'motiox_unset_url_field');
//function motiox_unset_url_field($fields) {
//    if (isset($fields['url']))
//        unset($fields['url']);
//    return $fields;
//}
© 2026 GrazzMean-Shell