2017 © Pedro Peláez
 

wordpress-plugin address

image

carawebs/address

  • Saturday, March 31, 2018
  • by DavidEgan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Address WordPress Plugin

Work in Progress. Use at your own risk., (*1)

Adds an option page to add Physical address data to the options table of the database., (*2)

Builds the address data into a HTML block that is properly marked up according to schema.org., (*3)

Uses the WP Plugin Boilerplate., (*4)

Installation

  1. Clone this repo to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Add address data to your site: Dashboard >> Settings >> Address & Contact
  4. Place <?php do_action('carawebs_address'); ?> in your templates
  5. Use the shortcode [address] in the content area

Available Filters

Filter Hook Value Variables
'carawebs_address_open_div' '<div class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">' -
'carawebs_address_business_name' '<h3><span itemprop="name">' . $business_name . '</span></h3>' $business_name
'carawebs_address_line_1' '<span itemprop="streetAddress">' . $address_line_1 . '</span><br />' $address_line_1
'carawebs_address_line_2' '<span itemprop="streetAddress">' . $address_line_2 . '</span><br />' $address_line_2
'carawebs_address_town' '<span itemprop="addressLocality">' . $town . '</span><br />' $town
'carawebs_address_county' '<span itemprop="addressLocality">' . $address['county'] . '</span><br />' $county
'carawebs_address_country' '<span itemprop="addressCountry">' . $country . '</span><br />' $country
'carawebs_address_postcode' '<span itemprop="postalCode">' . $postcode . '</span>' $postcode
'carawebs_address_close_div' '</div>' -

Example Filter

The 'carawebs_address_business_name' filter receives two parameters:, (*5)

  • '<h3><span itemprop="name">' . $business_name . '</span></h3>'
  • $business_name

An sample use of this filter within a theme would be:, (*6)

<?php
add_filter( 'carawebs_address_business_name', __NAMESPACE__ . '\\filter_business_name', 1, 2 );

function filter_business_name( $content, $business_name ){

    return '<h4><span itemprop="name">' . $business_name . '</span></h4>';

}

Changelog

1.0 * First Commit., (*7)

The Versions

31/03 2018

v1.0-beta.1

1.0.0.0-beta1

  Sources   Download

25/02 2017

dev-settings

dev-settings https://github.com/DavidCWebs/address

A WordPress plugin which allows users to set address & contact data.

  Sources   Download

MIT

The Requires

 

wordpress

16/01 2017

dev-master

9999999-dev https://github.com/DavidCWebs/address

A WordPress plugin which allows users to set address & contact data.

  Sources   Download

MIT

The Requires

 

wordpress

16/01 2017

1.0.0

1.0.0.0 https://github.com/DavidCWebs/address

A WordPress plugin which allows users to set address & contact data.

  Sources   Download

MIT

The Requires

 

wordpress

16/01 2017

v1.0.0-beta.2

1.0.0.0-beta2 https://github.com/DavidCWebs/address

A WordPress plugin which allows users to set address & contact data.

  Sources   Download

MIT

The Requires

 

wordpress