wordpress-plugin

Wordpress custom plugin not shown in roles except admin

柔情痞子 提交于 2019-12-25 08:15:57
问题 I wrote a custom wordpress plugin that is shown in the left menu bar in the backend of WP. My problem is, that it is just shown if I log in as an administrator. If the editor logs in he can't see it. Is there any way that I can enable it so that every role can see it? I tried to google the problem but didn't get any satisfying results, that's why I am asking it here. Thanks for your answer! 回答1: You need to set the proper capability, third parameter in the add_option_page() function which you

How to add additional settings on error in Contact form 7?

﹥>﹥吖頭↗ 提交于 2019-12-25 06:26:01
问题 I already know the function 'on_sent_ok' to add jQuery actions when the form is submitted with success. However I want to display a modal window alerting the user when there are submitting erros. There's some function like the one above, but to be called on errors? 回答1: In version 3.3 new jQuery custom event triggers were introduced: New: Introduce 5 new jQuery custom event triggers (invalid.wpcf7, spam.wpcf7, mailsent.wpcf7, mailfailed.wpcf7, submit.wpcf7). See: http://contactform7.com/2012

Rename files during upload within Wordpress and Gravity Form

北城以北 提交于 2019-12-25 05:03:41
问题 Renaming the file is working as instructed here Rename files during upload within Wordpress In my scenario all files will be uploaded via a gravity form on a page ( /upload ). This method is naming every file Upload.mp3 instead of Post Name.mp3 . Can this method be modified to work in my scenario? 来源: https://stackoverflow.com/questions/13809555/rename-files-during-upload-within-wordpress-and-gravity-form

Format wordpress posts to use post title in URL instead of numeric autoincrement?

 ̄綄美尐妖づ 提交于 2019-12-25 03:53:38
问题 All my blog post URLs currently look like this: http://www.HeyItsMyBlog.com/?p=368 I want to change the URLs so instead they look like http://www.HeyItsMyBlog.com/2010/11/new-kittens-omg/ This is an easy change in the WordPress admin panel, but there are a bunch of people who have linked to my currently-formatted URLs around the web. How can I make the transition and ensure that it won't break the old links? 回答1: The latest version of Wordpress automagically interprets URLs of the form ?p=777

Creating an interactive map with wordpress [closed]

吃可爱长大的小学妹 提交于 2019-12-25 03:38:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I 'm in the research stage to create a interactive map like http://www.locksmithdirectory.com/ ! using themes or plugins ! 回答1: You could try to use the Google Geochart API to create a similar map. It allows to create interactive maps and to capture click events. You can find more information and examples here:

Get user metadata and display in WP_List_Table

无人久伴 提交于 2019-12-25 01:28:37
问题 I'm trying to get user metada in this case I will find for username or user firstname or lastname from within WP_List_Table class. Since I have a field called users_id where I store the wp_users.ID value then I did this in function get_sql_results() : private function get_sql_results() { global $wpdb; $search = ( isset($_REQUEST['s']) ) ? $_REQUEST['s'] : false; $do_search = ( $search ) ? " WHERE firstname LIKE '%$search%' OR lastname LIKE '%$search%' OR foid LIKE '%$search%' OR no_frequent

Wordpress get_posts attachments orderby

ⅰ亾dé卋堺 提交于 2019-12-25 00:36:54
问题 I am using this to get a list of all attachments of a post in Wordpress 3.2 $args = array( 'numberposts' => -1, 'post_status' => 'any', 'post_type' => 'attachment', 'orderby' => 'title', 'order' => 'ASC' ); get_posts($args); Nothing I do in the 'orderby' argument has any effect on the order in which the attachments are displayed. Can you order attachments by title? alphabetical order? in Wordpress 回答1: Try sorting the returned array using array_multisort() and the 'title' key. 来源: https:/

Wordpress custom post action hook

穿精又带淫゛_ 提交于 2019-12-24 14:18:46
问题 I'm working on a plugin for wordpress that I would like to fire every time a custom post of the type 'job' is posted, published, edited, trashed, untrashed, etc. (basically whenever there is an update to that post type). I'm having a bit of trouble finding the correct action hook to call. I have searched, and from my understanding I can't use for example (publish_post) because I am using a custom post type, so it should be something along the lines of (publish_job). However, that doesn't seem

jquery script of wordpress plugin dont work in content loaded via ajax

做~自己de王妃 提交于 2019-12-24 14:14:53
问题 I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over. An example of its usage is here: http://restoredisrael.org/blog/961/footnote-plugin-test-page/ In addition, in my single.php, I am showing metadata from custom fields using tabbed content. In other words, when clicking on a tab, a custom field is loaded via ajax on the div, and this content is containing footnotes. The jquery function managing tabs is: function tab(var) { $

Contact form 7 post to .asp

喜欢而已 提交于 2019-12-24 14:08:05
问题 Is it possible to post the form contents of Contact Form 7 form fields to an awaiting .asp page? My form has four input fields and one hidden field. Name, Telephone, Email, HowFoundUs, Refer. I want to post those input values to the following .asp page: clientsite.com/default.asp?name=xxxxxx&telephone=xxxxxxxx&howfoundus=xxxxxx&email=xxxxx&refer=xxxxxxx I have been searching through the plugin files and have yet to find anything. 回答1: Yes, you have to change the "action" attribute in the form