Skip to content

Commit

Permalink
Merge branch 'widget'
Browse files Browse the repository at this point in the history
  • Loading branch information
misterzym committed Oct 3, 2019
2 parents b2ae0ae + 023aff3 commit 86d45d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions github-embed.php
Expand Up @@ -159,10 +159,10 @@ public function handle_oembed() {


/**
* Функция обработки URL, вернет JSON или объект ссылки, если $echos будет true
* Return or echo json info on url GitHub
*
* @param string url
* @param boolean вывод json или возврат объекта
* @param boolean return object or echo json. Default echo json
* @return object version,size,template
*/

Expand Down
17 changes: 8 additions & 9 deletions widget.php
Expand Up @@ -7,21 +7,20 @@ function wpb_load_widget() {


/**
* Виджет бокового вида группы ВК
* Widget class
*
* @package Minecraft\widgets
*/
class gitHub extends WP_Widget {

private $fields = array('title' => '','url'=>'');
private $descrField = array('title' => 'Заголовок блока','url'=>'Ссылка на гитхаб');
private $descrField = array('title' => 'Title widget','url'=>'Url to get info');

public function __construct() {//конструктор
parent::__construct("gitHub", "Виджет вывода инфы из гитхаба", array("description" => "Выводит инфу из гитхаба на сайт"));
parent::__construct("gitHub", "Echo info on url GitHub", array("description" => "Echo info on url GitHub"));
}

/**
* Основной класс виджета
* Work on frontend
*
* @param array $args
* @param array $instance
Expand All @@ -35,7 +34,7 @@ public function widget($args, $instance) {
}

/**
* вывод в админке
* Work on backend interface
*
* @param array $instance
*/
Expand All @@ -44,7 +43,7 @@ public function form($instance) {
}

/**
* обновление настроек
* Update Settings
*
* @param array $newInstance
* @param array $oldInstance
Expand All @@ -55,7 +54,7 @@ public function update($newInstance, $oldInstance) {//
}

/**
* Генератор полей для админки
* Gen fields in backend
*
* @param array $instance
* @param array $update
Expand All @@ -82,4 +81,4 @@ private function genField($instance, $update = false) {
}

}
?>
?>

0 comments on commit 86d45d6

Please sign in to comment.