| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/jetpack/modules/shortcodes/ |
Upload File : |
<?php
/**
* Embed WordAds 'ad' in post
*/
class Jetpack_WordAds_Shortcode {
private $scripts_and_style_included = false;
function __construct() {
add_action( 'init', array( $this, 'action_init' ) );
}
/**
* Register our shortcode and enqueue necessary files.
*/
function action_init() {
global $wordads;
if ( empty( $wordads ) ) {
return null;
}
add_shortcode( 'wordads', array( $this, 'wordads_shortcode' ) );
}
/**
* Our [wordads] shortcode.
* Prints a WordAds Ad.
*
* @param array $atts Array of shortcode attributes.
* @param string $content Post content.
*
* @return string HTML for WordAds shortcode.
*/
static function wordads_shortcode( $atts, $content = '' ) {
$atts = shortcode_atts( array(), $atts, 'wordads' );
return self::wordads_shortcode_html( $atts, $content );
}
/**
* The shortcode output
*
* @param array $atts Array of shortcode attributes.
* @param string $content Post content.
*
* @return string HTML output
*/
static function wordads_shortcode_html( $atts, $content = '' ) {
global $wordads;
if ( empty( $wordads ) ) {
return '<div>' . __( 'The WordAds module is not active', 'jetpack' ) . '</div>';
}
$html = '<div class="jetpack-wordad" itemscope itemtype="https://schema.org/WPAdBlock"></div>';
$html = $wordads->insert_inline_ad( $html );
return $html;
}
}
new Jetpack_WordAds_Shortcode();