• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/ultimate-member/includes/widgets/class-um-search-widget.php
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
    ​x
     
    1
    <?php
    2
    namespace um\widgets;
    3
    ​
    4
    ​
    5
    // Exit if accessed directly
    6
    if ( ! defined( 'ABSPATH' ) ) exit;
    7
    ​
    8
    ​
    9
    /**
    10
     * Class UM_Search_Widget
    11
     * @package um\widgets
    12
     */
    13
    class UM_Search_Widget extends \WP_Widget {
    14
    ​
    15
    ​
    16
        /**
    17
         * UM_Search_Widget constructor.
    18
         */
    19
        function __construct() {
    20
    ​
    21
            parent::__construct(
    22
    ​
    23
            // Base ID of your widget
    24
            'um_search_widget',
    25
    ​
    26
            // Widget name will appear in UI
    27
            __( 'Ultimate Member - Search', 'ultimate-member' ),
    28
    ​
    29
            // Widget description
    30
            array( 'description' => __( 'Shows the search member form.', 'ultimate-member' ), )
    31
            );
    32
    ​
    33
        }
    34
    ​
    35
    ​
    36
        /**
    37
         * Creating widget front-end
    38
         *
    39
         * @param array $args
    40
         * @param array $instance
    41
         */
    42
        public function widget( $args, $instance ) {
    43
    ​
    44
            $title = apply_filters( 'widget_title', $instance['title'] );
    45
    ​
    46
            // before and after widget arguments are defined by themes
    47
            echo $args['before_widget'];
    48
            if ( ! empty( $title ) ) {
    49
                echo $args['before_title'] . $title . $args['after_title'];
    50
            }
    51
    ​
    52
            // display the search form
    53
            if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) {
    54
                echo do_shortcode( '[ultimatemember_searchform /]' );
    55
            } else {
    56
                echo apply_shortcodes( '[ultimatemember_searchform /]' );
    57
            }
    58
    ​
    59
    ​
    60
            echo $args['after_widget'];
    61
        }
    62
    ​
    63
    ​
    64
        /**
    65
         * Widget Backend
    66
         *
    67
         * @param array $instance
    68
         */
    69
        public function form( $instance ) {
    70
            if ( isset( $instance[ 'title' ] ) ) {
    71
                $title = $instance[ 'title' ];
    72
            } else {
    73
                $title = __( 'Search Users', 'ultimate-member' );
    74
            }
    75
    ​
    76
            if ( isset( $instance[ 'max' ] ) ) {
    77
                $max = $instance[ 'max' ];
    78
            } else {
    79
                $max = 11;
    80
            }
    81
    ​
    82
            // Widget admin form
    83
            ?>
    84
    ​
    85
            <p>
    86
                <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'ultimate-member' ); ?>:</label>
    87
                <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
    88
                       name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text"
    89
                       value="<?php echo esc_attr( $title ); ?>" />
    90
            </p>
    91
    ​
    92
            <?php
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.