Skip to content

Commit 92ff663

Browse files
committed
curl update
0 parents  commit 92ff663

30 files changed

+3472
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

LICENSE.txt

+339
Large diffs are not rendered by default.

README.txt

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
=== Display Medium Posts ===
2+
Contributors: acekyd
3+
Tags: medium, shortcodes, posts, medium.com
4+
Donate link: http://www.acekyd.com
5+
Requires at least: 3.0.1
6+
Tested up to: 4.6.1
7+
License: GPLv2 or later
8+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9+
10+
Display Medium Posts is a wordpress plugin that allows users display posts from medium.com on any part of their website.
11+
12+
== Description ==
13+
Display Medium Posts is a wordpress plugin that allows users display posts from medium.com on any part of their website.
14+
15+
== Installation ==
16+
From the WP admin panel, click \"Plugins\" -> \"Add new\".
17+
In the browser input box, type \"WP Edit\".
18+
Select the \"Display Medium Posts\" plugin (authored by \"acekyd\"), and click \"Install\".
19+
Activate the plugin.
20+
OR...
21+
22+
Download the plugin from this page.
23+
Save the .zip file to a location on your computer.
24+
Open the WP admin panel, and click \"Plugins\" -> \"Add new\".
25+
Click \"upload\".. then browse to the .zip file downloaded from this page.
26+
Click \"Install\".. and then \"Activate plugin\".
27+
OR...
28+
29+
Download the plugin from this page.
30+
Extract the .zip file to a location on your computer.
31+
Use either FTP or your hosts cPanel to gain access to your website file directories.
32+
Browse to the wp-content/plugins directory.
33+
Upload the extracted wp_edit folder to this directory location.
34+
Open the WP admin panel.. click the \"Plugins\" page.. and click \"Activate\" under the newly added \"WP Edit\" plugin.
35+
36+
== Frequently Asked Questions ==
37+
Nothing at the moment.
38+
39+
== Screenshots ==
40+
1. Add shortcode to posts/page
41+
2. Displayed latest medium posts on page.
42+
3. Allowed users to choose between carousel or list displays.
43+
44+
== Changelog ==
45+
46+
= Version 3.5 =
47+
48+
* Stopped posts from appearing above other content in some cames
49+
* Images now appear in list mode.
50+
* Links now open in new tab.
51+
* Show proper message instead of error when no posts are found.
52+
53+
54+
= Version 3.0 =
55+
56+
* Added Feature to fetch posts from publications.
57+
* Updated date displayed to date published from date created at.
58+
* Updated Admin dashboard with more details
59+
60+
61+
62+
= Version 2.1 =
63+
64+
* Updated code to match medium's new structure
65+
* Fixed bugs with list display
66+
67+
68+
= Version 2.0.2 =
69+
70+
* Choose to display posts in list format
71+
72+
= Version 2.0.0 =
73+
74+
* Specify tags and css classes to allow users customize post display
75+
76+
* Added option to specify total number of posts to be fetched
77+
78+
* Added option to specify post offsets
79+
80+
* Fixed broken images
81+
82+
* Added option to specify custom user default images for broken images
83+
84+
* Added option to customize number of posts to be in view in the carousel at a time
85+
86+
= Version 1.0.0. =
87+
88+
* Display Posts in carousel
+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?php
2+
3+
/**
4+
* The admin-specific functionality of the plugin.
5+
*
6+
* @link http://www.acekyd.com
7+
* @since 1.0.0
8+
*
9+
* @package Display_Medium_Posts
10+
* @subpackage Display_Medium_Posts/admin
11+
*/
12+
13+
/**
14+
* The admin-specific functionality of the plugin.
15+
*
16+
* Defines the plugin name, version, and two examples hooks for how to
17+
* enqueue the admin-specific stylesheet and JavaScript.
18+
*
19+
* @package Display_Medium_Posts
20+
* @subpackage Display_Medium_Posts/admin
21+
* @author AceKYD <[email protected]>
22+
*/
23+
class Display_Medium_Posts_Admin {
24+
25+
/**
26+
* The ID of this plugin.
27+
*
28+
* @since 1.0.0
29+
* @access private
30+
* @var string $plugin_name The ID of this plugin.
31+
*/
32+
private $plugin_name;
33+
34+
/**
35+
* The version of this plugin.
36+
*
37+
* @since 1.0.0
38+
* @access private
39+
* @var string $version The current version of this plugin.
40+
*/
41+
private $version;
42+
43+
/**
44+
* Initialize the class and set its properties.
45+
*
46+
* @since 1.0.0
47+
* @param string $plugin_name The name of this plugin.
48+
* @param string $version The version of this plugin.
49+
*/
50+
public function __construct( $plugin_name, $version ) {
51+
52+
$this->plugin_name = $plugin_name;
53+
$this->version = $version;
54+
$this->display_medium_posts_options = get_option($this->plugin_name);
55+
56+
}
57+
58+
/**
59+
* Register the stylesheets for the admin area.
60+
*
61+
* @since 1.0.0
62+
*/
63+
public function enqueue_styles() {
64+
65+
/**
66+
* This function is provided for demonstration purposes only.
67+
*
68+
* An instance of this class should be passed to the run() function
69+
* defined in Display_Medium_Posts_Loader as all of the hooks are defined
70+
* in that particular class.
71+
*
72+
* The Display_Medium_Posts_Loader will then create the relationship
73+
* between the defined hooks and the functions defined in this
74+
* class.
75+
*/
76+
77+
if ( 'settings_page_display-medium-posts' == get_current_screen() -> id ) {
78+
// CSS stylesheet for Color Picker
79+
wp_enqueue_style( 'wp-color-picker' );
80+
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/display-medium-posts-admin.css', array( 'wp-color-picker' ), $this->version, 'all' );
81+
}
82+
83+
84+
}
85+
86+
/**
87+
* Register the JavaScript for the admin area.
88+
*
89+
* @since 1.0.0
90+
*/
91+
public function enqueue_scripts() {
92+
93+
/**
94+
* This function is provided for demonstration purposes only.
95+
*
96+
* An instance of this class should be passed to the run() function
97+
* defined in Display_Medium_Posts_Loader as all of the hooks are defined
98+
* in that particular class.
99+
*
100+
* The Display_Medium_Posts_Loader will then create the relationship
101+
* between the defined hooks and the functions defined in this
102+
* class.
103+
*/
104+
105+
if ( 'settings_page_display-medium-posts' == get_current_screen() -> id ) {
106+
wp_enqueue_media();
107+
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/display-medium-posts-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, false );
108+
}
109+
110+
}
111+
112+
/**
113+
* Register the administration menu for this plugin into the WordPress Dashboard menu.
114+
*
115+
* @since 1.0.0
116+
*/
117+
118+
public function add_plugin_admin_menu() {
119+
120+
/*
121+
* Add a settings page for this plugin to the Settings menu.
122+
*
123+
* NOTE: Alternative menu locations are available via WordPress administration menu functions.
124+
*
125+
* Administration Menus: http://codex.wordpress.org/Administration_Menus
126+
*
127+
*/
128+
add_options_page( 'Display Medium Posts', 'Medium Posts', 'manage_options', $this->plugin_name, array($this, 'display_plugin_setup_page')
129+
);
130+
}
131+
132+
/**
133+
* Add settings action link to the plugins page.
134+
*
135+
* @since 1.0.0
136+
*/
137+
138+
public function add_action_links( $links ) {
139+
/*
140+
* Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
141+
*/
142+
$settings_link = array(
143+
'<a href="' . admin_url( 'options-general.php?page=' . $this->plugin_name ) . '">' . __('Settings', $this->plugin_name) . '</a>',
144+
);
145+
return array_merge( $settings_link, $links );
146+
147+
}
148+
149+
/**
150+
* Render the settings page for this plugin.
151+
*
152+
* @since 1.0.0
153+
*/
154+
155+
public function display_plugin_setup_page() {
156+
include_once( 'partials/display-medium-posts-admin-display.php' );
157+
}
158+
159+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* All of the CSS for your admin-specific functionality should be
3+
* included in this file.
4+
*/

admin/index.php

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php // Silence is golden
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
(function( $ ) {
2+
'use strict';
3+
4+
/**
5+
* All of the code for your admin-specific JavaScript source
6+
* should reside in this file.
7+
*
8+
* Note that this assume you're going to use jQuery, so it prepares
9+
* the $ function reference to be used within the scope of this
10+
* function.
11+
*
12+
* From here, you're able to define handlers for when the DOM is
13+
* ready:
14+
*
15+
* $(function() {
16+
*
17+
* });
18+
*
19+
* Or when the window is loaded:
20+
*
21+
* $( window ).load(function() {
22+
*
23+
* });
24+
*
25+
* ...and so on.
26+
*
27+
* Remember that ideally, we should not attach any more than a single DOM-ready or window-load handler
28+
* for any particular page. Though other scripts in WordPress core, other plugins, and other themes may
29+
* be doing this, we should try to minimize doing that in our own work.
30+
*/
31+
32+
})( jQuery );
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
/**
4+
* Provide a admin area view for the plugin
5+
*
6+
* This file is used to markup the admin-facing aspects of the plugin.
7+
*
8+
* @link http://www.acekyd.com
9+
* @since 1.0.0
10+
*
11+
* @package Display_Medium_Posts
12+
* @subpackage Display_Medium_Posts/admin/partials
13+
*/
14+
?>
15+
16+
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
17+
<div class="wrap">
18+
19+
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
20+
21+
<div class="metabox-holder">
22+
<div class="postbox-container" style="width: 55%;margin-right: 10px;">
23+
<div class="postbox">
24+
<h3 class="hndle ui-sortable-handle"><span>How to use</span></h3>
25+
<div class="inside">
26+
<p>WordPress Display Medium Posts plugin displays the latests posts from a specified user or publication.</p>
27+
28+
<h4>For users</h4>
29+
30+
<p>To use this plugin on any page/post, add shortcode with <strong>user</strong> handle e.g <br><span style="color:red">[display_medium_posts handle="@username"]</span></p>
31+
32+
<h4>For Publications</h4>
33+
<p>To use this plugin to fetch publication posts, you'd have to get the publication handle from the url as shown https://medium.com/<strong>devcenter</strong>. <strong>devcenter</strong> is the publication's handle. If you are using a custom domain, you should still be able to look up your unique handle in settings.</p>
34+
<p>To use this plugin on any page/post, add shortcode with <strong>publication</strong> handle and set "publication" to true e.g<br> <span style="color:red">[display_medium_posts handle="username" publication=true]</span></p>
35+
36+
<i>NB: Do not add "@" for publication handles</i>
37+
38+
<h4>Advanced Usage and Customization</h4>
39+
<p>There are additional features that can be implemented using Display Medium Posts : </p>
40+
<ul>
41+
<li><b>handle:</b> This is the user's medium handle e.g <strong>@acekyd</strong> or publication handle e.g <strong>devcenter</strong> <i>(Required)</i></li>
42+
<li><b>publication:</b> If you would like to show the posts of a publication's specified handle, set this value to true. Default value is false</li>
43+
<li><b>default_image:</b> This is the url of default image that should show when post doesn't have a featured image e.g http://i.imgur.com/p4juyuT.png</li>
44+
<li><b>display:</b> This is the amount of posts that should be displayed at a time e.g display=3</li>
45+
<li><b>offset:</b> This is used when you don't want to display the most recent posts. You can specify the offset to skip the first number of items specified. Default is 0 e.g offset=2</li>
46+
<li><b>total:</b> This is used to specify the amount of posts to fetch. Maximum is 10. This is also useful if you just want to display a single item e.g total=1</li>
47+
<li><b>list:</b> If you would like to show the posts in a list instead of a carousel, set this value to true. Default value is false</li>
48+
</ul>
49+
</div>
50+
</div>
51+
</div>
52+
53+
<div class="postbox-container" style="width: 44%;">
54+
<div class="postbox">
55+
<h3 class="hndle ui-sortable-handle"><span>More!</span></h3>
56+
<div class="inside">
57+
<p>
58+
An example of a full use of the plugin is as follows:<br><br>
59+
<strong>User - </strong><br><br>
60+
61+
[display_medium_posts handle="@acekyd" default_image="http://www.acekyd.com/wp-content/uploads/2014/11/IMG_20150731_220116.png" display=4 offset=2 total=10 list=false]
62+
63+
<br><br>
64+
<strong>Publication - </strong><br><br>
65+
66+
[display_medium_posts handle="devcenter" publication=true default_image="http://www.acekyd.com/wp-content/uploads/2014/11/IMG_20150731_220116.png" display=4 offset=2 total=10 list=false]
67+
68+
</p>
69+
<br><br>
70+
<p>
71+
<h4 style="color:red">If this plugin has helped you, don't hesitate to star the <a href="http://www.github.com/acekyd/display-medium-posts/" target="_blank">Github repo</a>. If you'd like to reach out to me or donate to this plugin, send me a tweet at <a href="http://twitter.com/ace_kyd">@Ace_KYD</a>. Cheers :)</h4>
72+
</p>
73+
</div>
74+
</div>
75+
</div>
76+
</div>
77+
</div>

0 commit comments

Comments
 (0)