at path:
ROOT
/
wp-content
/
plugins
/
wp-pagenavi
/
scb
/
Widget.php
run:
R
W
Run
AdminPage.php
12.5 KB
2023-05-06 13:06:44
R
W
Run
Delete
Rename
BoxesPage.php
7.07 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
Cron.php
4.88 KB
2021-02-22 10:38:24
R
W
Run
Delete
Rename
Forms.php
21.54 KB
2021-02-22 10:38:24
R
W
Run
Delete
Rename
Hooks.php
2.24 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
Options.php
3.82 KB
2019-10-21 18:26:48
R
W
Run
Delete
Rename
PostMetabox.php
6.91 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
Table.php
1.21 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
Util.php
10.06 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
Widget.php
2.61 KB
2015-08-08 16:48:34
R
W
Run
Delete
Rename
composer.json
631 By
2014-01-13 10:05:12
R
W
Run
Delete
Rename
load-composer.php
210 By
2015-08-08 16:48:34
R
W
Run
Delete
Rename
load.php
2.2 KB
2024-12-19 06:01:04
R
W
Run
Delete
Rename
error_log
up
📄
Widget.php
Save
<?php /** * Adds compatibility methods between WP_Widget and scbForms. */ abstract class scbWidget extends WP_Widget { /** * Widget defaults. * @var array */ protected $defaults = array(); /** * Widgets to register. * @var array */ private static $scb_widgets = array(); /** * Initializes widget. * * @param string $class * @param string $file (optional) * @param string $base (optional) * * @return void */ public static function init( $class, $file = '', $base = '' ) { self::$scb_widgets[] = $class; add_action( 'widgets_init', array( __CLASS__, '_scb_register' ) ); // for auto-uninstall if ( $file && $base && class_exists( 'scbOptions' ) ) { new scbOptions( "widget_$base", $file ); } } /** * Registers widgets. * * @return void */ public static function _scb_register() { foreach ( self::$scb_widgets as $widget ) { register_widget( $widget ); } } /** * Displays widget content. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. * * @return void */ public function widget( $args, $instance ) { $instance = wp_parse_args( $instance, $this->defaults ); extract( $args ); echo $before_widget; $title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base ); if ( ! empty( $title ) ) { echo $before_title . $title . $after_title; } $this->content( $instance ); echo $after_widget; } /** * This is where the actual widget content goes. * * @param array $instance The settings for the particular instance of the widget. * * @return void */ protected function content( $instance ) { } //_____HELPER METHODS_____ /** * Generates a input form field. * * @param array $args * @param array $formdata (optional) * * @return string */ protected function input( $args, $formdata = array() ) { $prefix = array( 'widget-' . $this->id_base, $this->number ); $form = new scbForm( $formdata, $prefix ); // Add default class if ( ! isset( $args['extra'] ) && 'text' == $args['type'] ) { $args['extra'] = array( 'class' => 'widefat' ); } // Add default label position if ( ! in_array( $args['type'], array( 'checkbox', 'radio' ) ) && empty( $args['desc_pos'] ) ) { $args['desc_pos'] = 'before'; } $name = $args['name']; if ( ! is_array( $name ) && '[]' == substr( $name, -2 ) ) { $name = array( substr( $name, 0, -2 ), '' ); } $args['name'] = $name; return $form->input( $args ); } }