Skip to content

Commit ad6b4cf

Browse files
committed
version 3.1.0, github updater
1 parent bc84776 commit ad6b4cf

File tree

120 files changed

+11006
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+11006
-5
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log
22
All notable changes to this project will be documented in this file, formatted via [this recommendation](http://keepachangelog.com/).
33

4+
### [3.1.0]
5+
#### Added
6+
* Plugin updates from GitHub
7+
* Support custom post statuses, props @nabrown
8+
* German translation, props @HenryJobst
9+
410
### [3.0.3]
511
#### Changed
612
* Bumped the "Tested To" number to WP 6.6

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Tags:** shortcode, pages, posts, page, query, display, list
55
**Requires at least:** 3.0
66
**Tested up to:** 6.6
7-
**Stable tag:** 3.0.3
7+
**Stable tag:** 3.1.0
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -28,7 +28,7 @@ See [these tutorials](https://displayposts.com/tutorials/) for many examples of
2828

2929
### Extensions
3030
* [Display Posts – Pagination](https://github.com/billerickson/Display-Posts-Pagination) – Allow results of Display Posts to be paginated
31-
* [Display Posts – Date View](https://wordpress.org/plugins/display-posts-date-view/) – Lets you break your content down by month or year.
31+
* [Display Posts – Date View](https://github.com/billerickson/display-posts-date-view/) – Lets you break your content down by month or year.
3232
* [Display Posts – Alpha View](https://github.com/billerickson/Display-Posts-Alpha-View) – Display an alphabetical listing of your content, broken down by letter
3333
* [Display Posts – Transient Cache](https://github.com/billerickson/Display-Posts-Transient-Cache) – Cache the output using transients
3434
* [Co-Authors Plus Addon](https://github.com/billerickson/dps-coauthor-addon) – multiple authors on posts

display-posts-shortcode.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Display Posts
44
* Plugin URI: https://displayposts.com
55
* Description: Display a listing of posts using the [display-posts] shortcode
6-
* Version: 3.0.3
6+
* Version: 3.1.0
77
* Author: Bill Erickson
88
* Author URI: https://www.billerickson.net
99
* Text Domain: display-posts
@@ -16,7 +16,7 @@
1616
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1717
*
1818
* @package Display Posts
19-
* @version 3.0.3
19+
* @version 3.1.0
2020
* @author Bill Erickson <[email protected]>
2121
* @copyright Copyright (c) 2011, Bill Erickson
2222
* @link https://displayposts.com
@@ -893,3 +893,19 @@ function be_dps_survey_dismiss() {
893893
update_option( 'display_posts_survey_2', $survey );
894894
}
895895
add_action( 'wp_ajax_display_posts_survey_dismiss', 'be_dps_survey_dismiss' );
896+
897+
/**
898+
* Plugin Updates
899+
*/
900+
function dps_plugin_updates() {
901+
require dirname( __FILE__ ) . '/updater/plugin-update-checker.php';
902+
903+
$myUpdateChecker = \YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
904+
'https://github.com/billerickson/display-posts-shortcode',
905+
__FILE__, //Full path to the main plugin file or functions.php.
906+
'display-posts-shortcode'
907+
);
908+
909+
$myUpdateChecker->setBranch('master');
910+
}
911+
add_action( 'admin_init', 'dps_plugin_updates' );

readme.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Here are [tutorials for popular event calendar plugins](https://displayposts.com
5959
**Extensions**
6060

6161
* [Display Posts – Pagination](https://github.com/billerickson/Display-Posts-Pagination) – Allow results of Display Posts to be paginated
62-
* [Display Posts – Date View](https://wordpress.org/plugins/display-posts-date-view/) – Lets you break your content down by month or year.
62+
* [Display Posts – Date View](https://github.com/billerickson/display-posts-date-view/) – Lets you break your content down by month or year.
6363
* [Display Posts – Alpha View](https://github.com/billerickson/Display-Posts-Alpha-View) – Display an alphabetical listing of your content, broken down by letter
6464
* [Display Posts – Transient Cache](https://github.com/billerickson/Display-Posts-Transient-Cache) – Cache the output using transients
6565
* [Co-Authors Plus Addon](https://github.com/billerickson/dps-coauthor-addon) – multiple authors on posts
@@ -78,6 +78,11 @@ Here are [tutorials for popular event calendar plugins](https://displayposts.com
7878

7979
== Changelog ==
8080

81+
**Version 3.1.0**
82+
* Plugin updates from GitHub
83+
* Support custom post statuses, props @nabrown
84+
* German translation, props @HenryJobst
85+
8186
**Version 3.0.3**
8287
* Bumped the "Tested To" number to WP 6.6
8388
* Updated text of the plugin notice

updater/.DS_Store

6 KB
Binary file not shown.

updater/.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[*]
2+
charset=utf-8
3+
end_of_line=lf
4+
insert_final_newline=false
5+
indent_style=tab
6+
tab_width=4
7+
8+
[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
9+
indent_style=space
10+
indent_size=4
11+
12+
[*.svg]
13+
indent_style=space
14+
indent_size=4
15+

updater/Puc/.DS_Store

6 KB
Binary file not shown.

updater/Puc/v5/PucFactory.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace YahnisElsts\PluginUpdateChecker\v5;
4+
5+
if ( !class_exists(PucFactory::class, false) ):
6+
7+
class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p4\PucFactory {
8+
}
9+
10+
endif;

updater/Puc/v5p4/.DS_Store

6 KB
Binary file not shown.

updater/Puc/v5p4/Autoloader.php

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
namespace YahnisElsts\PluginUpdateChecker\v5p4;
4+
5+
if ( !class_exists(Autoloader::class, false) ):
6+
7+
class Autoloader {
8+
const DEFAULT_NS_PREFIX = 'YahnisElsts\\PluginUpdateChecker\\';
9+
10+
private $prefix;
11+
private $rootDir;
12+
private $libraryDir;
13+
14+
private $staticMap;
15+
16+
public function __construct() {
17+
$this->rootDir = dirname(__FILE__) . '/';
18+
19+
$namespaceWithSlash = __NAMESPACE__ . '\\';
20+
$this->prefix = $namespaceWithSlash;
21+
22+
$this->libraryDir = $this->rootDir . '../..';
23+
if ( !self::isPhar() ) {
24+
$this->libraryDir = realpath($this->libraryDir);
25+
}
26+
$this->libraryDir = $this->libraryDir . '/';
27+
28+
//Usually, dependencies like Parsedown are in the global namespace,
29+
//but if someone adds a custom namespace to the entire library, they
30+
//will be in the same namespace as this class.
31+
$isCustomNamespace = (
32+
substr($namespaceWithSlash, 0, strlen(self::DEFAULT_NS_PREFIX)) !== self::DEFAULT_NS_PREFIX
33+
);
34+
$libraryPrefix = $isCustomNamespace ? $namespaceWithSlash : '';
35+
36+
$this->staticMap = array(
37+
$libraryPrefix . 'PucReadmeParser' => 'vendor/PucReadmeParser.php',
38+
$libraryPrefix . 'Parsedown' => 'vendor/Parsedown.php',
39+
);
40+
41+
//Add the generic, major-version-only factory class to the static map.
42+
$versionSeparatorPos = strrpos(__NAMESPACE__, '\\v');
43+
if ( $versionSeparatorPos !== false ) {
44+
$versionSegment = substr(__NAMESPACE__, $versionSeparatorPos + 1);
45+
$pointPos = strpos($versionSegment, 'p');
46+
if ( ($pointPos !== false) && ($pointPos > 1) ) {
47+
$majorVersionSegment = substr($versionSegment, 0, $pointPos);
48+
$majorVersionNs = __NAMESPACE__ . '\\' . $majorVersionSegment;
49+
$this->staticMap[$majorVersionNs . '\\PucFactory'] =
50+
'Puc/' . $majorVersionSegment . '/Factory.php';
51+
}
52+
}
53+
54+
spl_autoload_register(array($this, 'autoload'));
55+
}
56+
57+
/**
58+
* Determine if this file is running as part of a Phar archive.
59+
*
60+
* @return bool
61+
*/
62+
private static function isPhar() {
63+
//Check if the current file path starts with "phar://".
64+
static $pharProtocol = 'phar://';
65+
return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol);
66+
}
67+
68+
public function autoload($className) {
69+
if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) {
70+
include($this->libraryDir . $this->staticMap[$className]);
71+
return;
72+
}
73+
74+
if ( strpos($className, $this->prefix) === 0 ) {
75+
$path = substr($className, strlen($this->prefix));
76+
$path = str_replace(array('_', '\\'), '/', $path);
77+
$path = $this->rootDir . $path . '.php';
78+
79+
if ( file_exists($path) ) {
80+
include $path;
81+
}
82+
}
83+
}
84+
}
85+
86+
endif;

0 commit comments

Comments
 (0)