Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Callback Hook: ajax_dropdowns_callback #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
ajax-dropdowns
==============
* Contributors: brianmiyaji, twinpictures
* Tags: ajax, dropdowns, option, posts, pages, custom post types, tabs, groups, redirect, inline
* Requires at least: 3.0
* Tested up to: 4.9.1
* Stable tag: 0.9.9
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description
-----------
Add content from multiple post types on one page with a dropdown to switch between them. Dropdowns are displayed on the frontend of your site and can query posts via Ajax, inline, or redirection.

= Features =
* Create unlimited dropdowns
* Display on any post or page using the included shortcode
* Drag and drop posts to reorder them within a dropdown
* Decrease page load by dynamically querying posts via Ajax
* Use inline dropdowns to quickly switch between posts
* Redirection method also available

= Get Involved =
Developers can contribute via the [Ajax Dropdowns GitHub Repository](https://github.com/ThemeBoy/ajax-dropdowns).
Translators can contribute new languages to Ajax Dropdowns and our other WordPress plugins through [Transifex](https://www.transifex.com/projects/p/wp-plugins/).

Installation
------------
= Minimum Requirements =
* WordPress 3.0 or greater
* PHP version 5.2.4 or greater
* MySQL version 5.0 or greater

= Automatic Installation =
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t even need to leave your web browser. To do an automatic install of Ajax Dropdown, log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.

In the search field type "Ajax Dropdown" and click Search Plugins. Once you’ve found the plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking Install Now. After clicking that link you will be asked if you’re sure you want to install the plugin. Click yes and WordPress will automatically complete the installation.

= Manual Installation =
The manual installation method involves downloading the plugin and uploading it to your webserver via your favorite FTP application.

1. Download the plugin file to your computer and unzip it
1. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins/ directory.
1. Activate the plugin from the Plugins menu within the WordPress admin.

= Upgrading =
Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
11 changes: 7 additions & 4 deletions ajax-dropdowns.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
/**
* @package Ajax_Dropdowns
* @version 0.9.8
* @version 0.9.9
*/
/*
Plugin Name: Ajax Dropdowns
Plugin URI: http://wordpress.org/plugins/ajax-dropdowns/
Description: Display a group of posts that can be switched using dropdowns.
Author: Brian Miyaji
Version: 0.9.8
Version: 0.9.9
Author URI: http://themeboy.com/
*/

Expand Down Expand Up @@ -52,7 +52,7 @@ public function __construct() {
*/
private function define_constants() {
if ( !defined( 'AJAX_DROPDOWNS_VERSION' ) )
define( 'AJAX_DROPDOWNS_VERSION', '0.9.8' );
define( 'AJAX_DROPDOWNS_VERSION', '0.9.9' );

if ( !defined( 'AJAX_DROPDOWNS_URL' ) )
define( 'AJAX_DROPDOWNS_URL', plugin_dir_url( __FILE__ ) );
Expand Down Expand Up @@ -369,7 +369,7 @@ public static function shortcode( $atts ) {
$select .= '<option value="' . $post_id . '" data-permalink="' . get_permalink( $post_id ) . '" ' . selected( $current, $post_id, false ) . '>' . get_the_title( $post_id ) . '</option>';
endif; endforeach;
$select .= '</select>';

/**
* Select script (defaults to ajax)
*/
Expand Down Expand Up @@ -451,6 +451,9 @@ public static function ajax_callback() {

endwhile;

// Add callback hook to play well with others
do_action('ajax_dropdowns_callback');

die();
}

Expand Down
10 changes: 7 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
=== Ajax Dropdowns ===
Contributors: brianmiyaji
Contributors: brianmiyaji, twinpictures
Tags: ajax, dropdowns, option, posts, pages, custom post types, tabs, groups, redirect, inline
Requires at least: 3.0
Tested up to: 4.7
Stable tag: 0.9.8
Tested up to: 4.9.1
Stable tag: 0.9.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Display a group of posts that can be switched using dropdowns.

Expand Down Expand Up @@ -62,6 +63,9 @@ Automatic updates should work like a charm; as always though, ensure you backup

== Changelog ==

= 0.9.9 =
* Feature - Added callback on successful content load.

= 0.9.8 =
* Fix - Automatically display content of first option in widget.

Expand Down