Plugin Directory

Changeset 1465855


Ignore:
Timestamp:
08/02/2016 08:11:32 AM (10 years ago)
Author:
airspray
Message:

Version 1.3
Added some code to make it 4.5 compatible
New author: airspray

Location:
page-in-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • page-in-widget/trunk/page-in-widget.php

    r406643 r1465855  
    22/**
    33 * @package Page_in_widget
    4  * @version 1.2
     4 * @version 1.3
    55 */
    66/*
    77  Plugin Name: Page in Widget
    8   Plugin URI: http://carl-fredrik.net/wordpress/page-in-widget.html
    98  Description: Displays a page content in a widget
    10   Version: 1.2
    11   Author: Carl-Fredrik Herö
    12   Author URI: http://carl-fredrik.net
     9  Version: 1.3
     10  Author: Niklas Lampén
     11  Author URI: https://www.aava.eu/
    1312  License: GPL2
    1413 */
    1514
    1615/*  Copyright 2010  Carl-Fredrik Herö ([email protected])
     16    Copyright 2016  Niklas Lampén ([email protected])
    1717
    1818  This program is free software; you can redistribute it and/or modify
     
    3434 */
    3535class page_in_widget_Widget extends WP_Widget {
    36 
    37     /** constructor */
    38     function page_in_widget_Widget() {
    39         parent::WP_Widget(false, 'Page in widget', array('description' => 'Displays a page content in a widget'));
     36   
     37    public function __construct() {
     38        parent::__construct('page_in_widget', 'Page in widget', array(
     39            'classname' => 'page_in_widget',
     40            'description' => 'Displays a page content in a widget'
     41        )
     42        );
    4043    }
    4144
    4245    /** @see WP_Widget::widget */
    43     function widget($args, $instance) {
     46    public function widget($args, $instance) {
    4447        extract($args);
    4548        $title = apply_filters('widget_title', $instance['title']);
     
    7275
    7376    /** @see WP_Widget::update */
    74     function update($new_instance, $old_instance) {
     77    public function update($new_instance, $old_instance) {
    7578        $instance = $old_instance;
    7679        $instance['title'] = strip_tags($new_instance['title']);
     
    8184
    8285    /** @see WP_Widget::form */
    83     function form($instance) {
     86    public function form($instance) {
    8487        $title = '';
    8588        $page_id = 0;
     
    115118     * adapted to suit the widget
    116119     */
    117     function get_the_content($post, $more = 1) {
     120    public function get_the_content($post, $more = 1) {
    118121        global $preview;
    119122
     
    158161// class page_in_widget_Widget
    159162// register page_in_widget
    160 add_action('widgets_init', create_function('', 'return register_widget("page_in_widget_Widget");'));
     163function register_page_in_widget() { return register_widget("page_in_widget_Widget"); }
     164add_action('widgets_init', 'register_page_in_widget');
  • page-in-widget/trunk/readme.txt

    r406648 r1465855  
    11=== Page in Widget ===
    2 Contributors: carlfredrik.hero
     2Contributors: airspray, carlfredrik.hero
    33Tags: page, widget
    4 Requires at least: 2.8
    5 Tested up to: 3.2
    6 Stable tag: 1.2
     4Requires at least: 3.2
     5Tested up to: 4.5
     6Stable tag: 1.3
     7License: GPLv2 or later
     8Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=niklas%40aava%2eeu&lc=FI&item_name=Page%20In%20Widget%20Plugin%20for%20WordPress&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
    79
    810A tiny plugin that displays a page content in a widget.
     
    2325== Changelog ==
    2426
     27= 1.3 =
     28* New author: <a href="https://profiles.wordpress.org/airspray">airspray</a>. Big thanks to original author <a href="https://profiles.wordpress.org/carlfredrikhero">carlfredrik.hero</a>
     29* Added support for WordPress 4.5
     30
    2531= 1.2 =
    2632* Added support for WPML translation (thanks to <a href="http://wordpress.org/support/profile/altert">altert</a>)
Note: See TracChangeset for help on using the changeset viewer.