Search
 
SCRIPT & CODE EXAMPLE
 

PHP

vc_map type number

<?php
// [bartag foo="foo-value"]
add_shortcode( 'bartag', 'bartag_func' );
function bartag_func( $atts ) {
 extract( shortcode_atts( array(
  'foo' => 'something'
 ), $atts ) );
  
 return "foo = {$foo}";
}
?>
Comment

vc_map type number

<?php
add_shortcode( 'bartag', 'bartag_func' );
function bartag_func( $atts ) {
 extract( shortcode_atts( array(
  'foo' => 'something',
  'color' => '#FFF'
 ), $atts ) );
  
 return "<div style='color:{$color};'>foo = {$foo}</div>";
}
?>
Comment

vc_map type number

<?php
add_shortcode( 'bartag', 'bartag_func' );
function bartag_func( $atts, $content = null ) { // New function parameter $content is added!
 extract( shortcode_atts( array(
  'foo' => 'something',
  'color' => '#FFF'
 ), $atts ) );
  
 $content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content
  
 return "<div style='color:{$color};' data-foo='${foo}'>{$content}</div>";
}
?>
Comment

vc_map type number

array(
  "type" => "textfield",
  "holder" => "div",
  "class" => "",
  "heading" => __( "Text", "my-text-domain" ),
  "param_name" => "foo",
  "value" => __( "This is test param for creating new project", "my-text-domain" ),
  "description" => __( "Enter foo.", "my-text-domain" )
Comment

PREVIOUS NEXT
Code Example
Php :: do shortcode wordpress 
Php :: laravel tinker factory 
Php :: Wordpress SVG Manually - function.php 
Php :: login with email or phone number laravel 
Php :: laravel abort_if 
Php :: php check internet connection 
Php :: ternary operator laravel blade 
Php :: php object to xml 
Php :: last day of previous month in php 
Php :: PHP Fatal error: Constructor test::test() cannot declare a return type in /home/iBMCb9/prog.php on line 6 
Php :: capitlise php 
Php :: laravel with trashed 
Php :: laravel nova create user 
Php :: yii2 get cookie 
Php :: twig create new array 
Php :: collection continue in laravel 
Php :: laravel forelse 
Php :: laravel convert number to si 
Php :: php tags 
Php :: php detect base64 encoding 
Php :: DB::rollback() 
Php :: tcpdf error unable to create output file in php 
Php :: is alphanumeric php 
Php :: php artisan services 
Php :: concat in laravel 8 
Php :: php guzzle client x-www-form-urlencoded 
Php :: laravel check collection has key 
Php :: phpspreadsheet edit excel file 
Php :: laravel create migration add column 
Php :: php parse html 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =