wordpress-plugin

How can I pass a variable wordpress shortcode

可紊 提交于 2019-12-12 02:57:51
问题 I'm writing a Wordpress plugin which dynamically creates a string. I want to insert this string in a meta tag using the wp_head hook. My plugin works as follows: I define a shortcode whose handler function declares an add_action(... that adds a special <meta> tag into the header. This works, BUT... My only problem is that I can't figure out how to pass the variable containing the string to get printed into the head. The variable isn't defined, even though I globalize it in my plugin. //INSIDE

Wordpress Editor text tab design issue?

强颜欢笑 提交于 2019-12-12 02:56:58
问题 I tried the Wp_editor in wordpress for the visual tab is working fine and the text tab is getting list order. <?php $settings = array( 'textarea_name' => 'message1', 'media_buttons' => true, 'tinymce' => array( 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' . 'bullist,blockquote,|,justifyleft,justifycenter' . ',justifyright,justifyfull,|,link,unlink,|' . ',spellchecker,wp_fullscreen,wp_adv' ) ); wp_editor( '', 'content', $settings ); ?> Also For the Visual Editor it

Calling paramenter, get UTF8 null return error in formatting.php

我只是一个虾纸丫 提交于 2019-12-12 02:32:50
问题 I am getting a related Catchable fatal error: Object of class WP_User could not be converted to string in /wp-includes/formatting.php on line 766. I found a thread that relates at https://wordpress.org/support/topic/catchable-fatal-error-object-of-class-wp_error-could-not-be-converted-to-string-11 The php I am using, which I think should be working is: add_filter('gform_field_value_pm_first', 'populate_pm_first'); function populate_pm_first($value){ return $user_info = get_userdata(get

Better Search box for wordpress

吃可爱长大的小学妹 提交于 2019-12-12 02:25:42
问题 Please take a look on this WordPress theme, when you click on search icon, a search box appear in the middle of page with a cool effect. I want to add this to my WordPress site. I have looked on google but still no luck, Please suggest me a plugin or article. Thanks 回答1: Hi There it work like this using bootstrap modal popup. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js

My first WordPress plugin - Can't get script to run

大兔子大兔子 提交于 2019-12-12 02:17:21
问题 I thought this would be really simple but have spent a few days and am stuck. The idea is to insert a form on a page via shortcode; the form calculates totals from user input. The script and form play fine together when placed in a single HTML file. In the plugin (as you will see), the JS and FORM file are called separately. Currently, the script loads in the output, the form loads on the page that has the shortcode, but the CALC function will not work, either locally or on my server. Here

Google map in wordpress plugin

白昼怎懂夜的黑 提交于 2019-12-12 02:15:48
问题 I have used Draggable Markers for google map http://gmaps-samples-v3.googlecode.com/svn/trunk/draggable-markers/draggable-markers.html. When I am using the smaple code on a simple html or php page then it's looking good same as on the link, but when I am using it in a wordpress plugin then the pointer of the map is not comeing in center and also the full map. it looks like http://www.screencast.com/users/Bidyut/folders/Default/media/10451777-2b22-40af-aa3e-c16d27e8ecf6 then when I am clicking

Wordpress - get_comment_author() returns anonymous

坚强是说给别人听的谎言 提交于 2019-12-12 02:05:52
问题 I have developed a wordpress plugin that inserts a JS script in the head of every page of the site. I am trying to pass a couple variables to the script (in PHP) such as the name, the email, and the website of the author of the comment, when there's a comment. I have tried to use the get_comment_author(), get_comment_author_url() and get_comment_author_email() but it always returns "Anonymous", even if I just entered a name, website and mail adress when posting a comment. Here is the code:

Wordpress Website Hack [closed]

柔情痞子 提交于 2019-12-12 02:03:46
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . i have a website in Wordpress Please take a look http://www.soulspectrum.org Now Problem is that sometimes it was hacked by some another one . it happens

OAuth 2.0 to Access Google APIs for Wordpress plugins

拥有回忆 提交于 2019-12-12 01:56:15
问题 I have a Wordpress plugin that will be used to display Youtube videos with YouTube Data API version 3. It will not request private information and will perform only read operations with the list method. I do not know what "Application type" (Web application, Service account or Installed application) I have to select in OAuth 2.0 to access Google APIs to use in a Wordpress plugin. Should I add my client id and client secret in the plugin? What is the most appropriate way to use the OAuth in an

Redirect When Search Query is an Exact Title in Wordpress

十年热恋 提交于 2019-12-12 01:48:27
问题 I have two post titles in Wordpress: post_title: gröband permalink: www.example.com/groband.html post_title: groband permalink: www.example.com/groband-2.html I want redirect when search query is " gröband " to www.example.com/groband.html if search query is " groband " redirect to www.example.com/groband-2.html 回答1: Edit your search template in theme editor and add this top <?php if(isset($_GET['s'])){ $url =""; switch($_GET['s']){ case 'gröband': $url = "http://www.example.com/groband.html"