Giter Club home page Giter Club logo

p2-hovercards's Introduction

=== P2 Hovercards ===
Contributors: betzster
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

API for adding hovercards on things like Zendesk, Trac, etc

== Description ==

P2 hovercards allows you to easily add hovercards to your P2 blog. This is useful for support tickets or anything that you might want to know more information about without necessarily clicking a link.

New services can be added with `p2_hovercards_add_service()`. It takes the name of the serivce, the regex pattern to find its tags, the regex replacement for a url and a ticket, and a callback for setting up data for the card. You get an 'id', 'service', and 'url'. The callback should return an array with 'title', 'subtitle', 'url', 'description', 'comments', 'meta', where 'comments' and 'meta' are arrays.

Use the following example or look in `examples.php` for more in depth examples:

	p2_hovercards_add_service( 'core_trac', '#(\d+)', '<a href="http://core.trac.wordpress.org/ticket/$1">$0</a>', '$1', function( $args ){
		$id = (int) $args[ 'id' ];
		$url = $args[ 'url' ];
		$service = $args[ 'service' ];

		// Do stuff with $id, $service, and $url
		
		return compact( 'title', 'subtitle', 'url', 'description', 'comments', 'meta' );
	});

== Screenshots ==

1. Sample hovercard for a core trac ticket

== Changelog ==

= 1.0 =
* Initial Release

p2-hovercards's People

Contributors

joshbetz avatar viper007bond avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.