コード例 #1
0
        function form($instance)
        {
            $instance = wp_parse_args((array) $instance, array('title' => 'Agent Related Properties', 'count' => 1, 'sort_by' => 'random'));
            $title = esc_attr($instance['title']);
            $agent = $instance['agent'];
            $sort_by = $instance['sort_by'];
            $count = $instance['count'];
            $featured = isset($instance['featured']) ? (bool) $instance['featured'] : false;
            ?>

            <p>
                <label for="<?php 
            echo $this->get_field_id('title');
            ?>
"><?php 
            _e('Widget Title', 'framework');
            ?>
</label>
                <input class="widefat" id="<?php 
            echo $this->get_field_id('title');
            ?>
" name="<?php 
            echo $this->get_field_name('title');
            ?>
" type="text" value="<?php 
            echo $title;
            ?>
" />
            </p>
            <p>
                <label for="<?php 
            echo $this->get_field_id('agent');
            ?>
"><?php 
            _e('Select an Agent:', 'framework');
            ?>
</label>
                <select name="<?php 
            echo $this->get_field_name('agent');
            ?>
" id="<?php 
            echo $this->get_field_id('agent');
            ?>
" class="widefat">
                    <?php 
            generate_posts_list('agent', $agent);
            ?>

                </select>
            </p>
            <p>
                <label for="<?php 
            echo $this->get_field_id('sort_by');
            ?>
"><?php 
            _e('Sort By:', 'framework');
            ?>
</label>
                <select name="<?php 
            echo $this->get_field_name('sort_by');
            ?>
" id="<?php 
            echo $this->get_field_id('sort_by');
            ?>
" class="widefat">
                    <option value="recent"<?php 
            selected($sort_by, 'recent');
            ?>
><?php 
            _e('Most Recent', 'framework');
            ?>
</option>
                    <option value="random"<?php 
            selected($sort_by, 'random');
            ?>
><?php 
            _e('Random', 'framework');
            ?>
</option>
                </select>
            </p>
            <p>
                <label for="<?php 
            echo $this->get_field_id('count');
            ?>
"><?php 
            _e('Number of Properties', 'framework');
            ?>
</label>
                <input id="<?php 
            echo $this->get_field_id('count');
            ?>
" name="<?php 
            echo $this->get_field_name('count');
            ?>
" type="text" value="<?php 
            echo $count;
            ?>
" size="3" />
            </p>
            <p>
                <input class="checkbox" id="<?php 
            echo $this->get_field_id('featured');
            ?>
" name="<?php 
            echo $this->get_field_name('featured');
            ?>
" type="checkbox" <?php 
            checked($featured);
            ?>
/>
                <label for="<?php 
            echo $this->get_field_id('featured');
            ?>
"><?php 
            _e('Show only Featured Properties.', 'framework');
            ?>
</label>
            </p>
        <?php 
        }
コード例 #2
0
                echo admin_url('profile.php');
                ?>
" target="_blank"><?php 
                _e('( You can add your profile information here )', 'framework');
                ?>
</a></small>
                                                    <br/>

                                                    <input id="agent_option_agent" type="radio" name="agent_display_option" value="agent_info" />
                                                    <label for="agent_option_agent"><?php 
                _e('Display an agent\'s information', 'framework');
                ?>
</label>
                                                    <select name="agent_id" id="agent-selectbox">
                                                        <?php 
                generate_posts_list('agent');
                ?>

                                                    </select>
                                                </div>
                                            </div>

                                            <?php 
                $submit_notice_email = get_option('theme_submit_notice_email');
                if (!empty($submit_notice_email)) {
                    ?>

                                                <div class="form-option">
                                                    <label for="message_to_reviewer"><?php 
                    _e('Message to the Reviewer', 'framework');
                    ?>