2017 © Pedro Peláez
 

library wp-ogp

A library for WordPress OGP.

image

inc2734/wp-ogp

A library for WordPress OGP.

  • Friday, July 27, 2018
  • by inc2734
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,451 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 24 % Grown

The README.md

WP OGP

Build Status Latest Stable Version License, (*1)

Install

$ composer require inc2734/wp-ogp

How to use

<?php
add_action(
    'wp_head',
    function() {
        $ogp = new \Inc2734\WP_OGP\Bootsrap();
        ?>
        <meta property="og:title" content="<?php echo esc_attr( $ogp->get_title() ); ?>">
        <meta property="og:type" content="<?php echo esc_attr( $ogp->get_type() ); ?>">
        <meta property="og:url" content="<?php echo esc_attr( $ogp->get_url() ); ?>">
        <meta property="og:image" content="<?php echo esc_attr( $ogp->get_image() ); ?>">
        <meta property="og:site_name" content="<?php echo esc_attr( $ogp->get_site_name() ); ?>">
        <meta property="og:description" content="<?php echo esc_attr( $ogp->get_description() ); ?>">
        <meta property="og:locale" content="<?php echo esc_attr( $ogp->get_locale() ); ?>">
        <?php
    }
);

Filter hooks

inc2734_wp_ogp_title

/**
 * Customize og:title
 *
 * @param string $title
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_title',
    function( $title ) {
        return $title;
    }
);

inc2734_wp_ogp_type

/**
 * Customize og:type
 *
 * @param string $type
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_type',
    function( $type ) {
        return $type;
    }
);

inc2734_wp_ogp_url

/**
 * Customize og:url
 *
 * @param string $url
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_url',
    function( $url ) {
        return $url;
    }
);

inc2734_wp_ogp_image

/**
 * Customize og:image
 *
 * @param string $image
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_image',
    function( $image ) {
        return $image;
    }
);

inc2734_wp_ogp_description

/**
 * Customize og:description
 *
 * @param string $description
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_description',
    function( $description ) {
        return $description;
    }
);

inc2734_wp_ogp_site_name

/**
 * Customize og:site_name
 *
 * @param string $site_name
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_site_name',
    function( $site_name ) {
        return $site_name;
    }
);

inc2734_wp_ogp_locale

/**
 * Customize og:locale
 *
 * @param string $locale
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_locale',
    function( locale ) {
        return $locale;
    }
);

inc2734_wp_ogp_app_id

/**
 * Customize fb:app_id
 *
 * @param string $app_id
 * @return string
 */
add_filter(
    'inc2734_wp_ogp_app_id',
    function( $app_id ) {
        return $app_id;
    }
);

The Versions

19/07 2018

1.0.2

1.0.2.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0-or-later

The Requires

  • php >=5.6

 

The Development Requires

04/03 2018

1.0.1

1.0.1.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0-or-later

The Requires

  • php >=5.6

 

The Development Requires

04/03 2018

1.0.0

1.0.0.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

30/09 2017

0.3.3

0.3.3.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

26/09 2017

0.3.2

0.3.2.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

23/07 2017

0.3.1

0.3.1.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

20/07 2017

0.3.0

0.3.0.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

11/07 2017

0.2.1

0.2.1.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

11/07 2017

0.2.0

0.2.0.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

29/06 2017

0.1.2

0.1.2.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.6

 

The Development Requires

13/06 2017

0.1.1

0.1.1.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3

 

The Development Requires

13/06 2017

0.1.0

0.1.0.0

A library for WordPress OGP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3

 

The Development Requires