Answer the question
In order to leave comments, you need to log in
How to add your shortcode to wordpress?
There is an algorithm, suggested here: Copying text by clicking on the text itself?
As I understand it, to add your own tag, let's say
<copy> тут текст, по нажатию на который он скопируется в буфер обмена</copy>
you need to add a shortcode (this will be the easiest), how can I describe and add such a shortcode (tag), when concluded in which the text will be copied to the clipboard, for example:Вот стандартная фраза, которую вы можете использовать в диалоге:
<copy> тут текст, по нажатию на который он скопируется в буфер обмена</copy>
<i>* для копирования нажмите на текст</i>
Answer the question
In order to leave comments, you need to log in
function bla_bla_bla( $atts, $content = null ) {
$params = shortcode_atts( [
'one' => '',
'two' => '',
'more' => '',
], $atts );
# my_copy_text_function гипотетическая функция которая, что то у вас делает
return my_copy_text_function( $params[ 'one' ], $params[ 'two' ], $params[ 'more' ], $content );
}
add_shortcode( 'my_short_code', 'bla_bla_bla' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question