wordpress-plugin

Create a Flash frontend for WordPress?

≯℡__Kan透↙ 提交于 2019-12-02 23:17:05
问题 My buddy wants to create a WordPress blog, but because he's picky about the design (specifically the fonts), he wants to use Flash for the frontend -- display, content creation, user interface, etc. He's looking for a plug-in that will take the user input from the Flash interface and convert it into the appropriate PHP for WordPress. I've never used Flash, so I didn't know what to tell him, other than that this sounds nuts. Is there a better answer than this? 回答1: Flash can store and retreive

How to get Post ID in Wordpress Admin

蹲街弑〆低调 提交于 2019-12-02 22:43:06
I'm developing a Wordpress plugin and I need to get the current Post ID in the Write Post / Write Page editing screen (outside the loop). I also need to do it before the "admin_print_scripts" hook, since I would like to pass some data to a javascript file. I can't use: $id = $_GET['post']; because the url doesn't include this variable when you are adding a new post or page. So far I've tried these options but none of them worked: A) This returns an ID of 0 function myplugin_setup() { global $wp_query; $id = $wp_query->get_queried_object_id(); var_dump($id); } add_action('admin_init', 'myplugin

Add results into WordPress search results

只谈情不闲聊 提交于 2019-12-02 20:56:50
I would like to add/inject/append extra results into the WordPress search results. At the moment WordPress only allows you to "adjust" the query that is being executed on its own database, but doesn't allow you to modify (or in WordPress lingo, filter) the results array. I.e: If in WordPress I search for the term 'potato' all posts related to this term come back. I want to include results that I've obtained via a different service into the WordPress results set. Just to clarify, I'm getting my results from a 3rd party API call. Not from the WordPress database. Does anyone have an idea on how I

Any downside to putting a button inside of an anchor?

≯℡__Kan透↙ 提交于 2019-12-02 20:24:33
问题 I'm building a wordpress plugin to add FB, Twitter, and LinkedIn share buttons to a post. I know it's been done a hundred times, but it's good practice and I'm putting a spin on it. Are there any downsides to putting a button inside of an anchor tag like so? <a href="#"><input type="submit" value="share to facebook" /></a> Your thoughts are appreciated. 回答1: It is forbidden by the HTML specification Some browsers will cause the link to break Some browsers will cause the button to break If you

Wordpress custom widget image upload

眉间皱痕 提交于 2019-12-02 17:18:47
I'm busy with building my own Wordpress Widget. Everything works fine except for the Wordpress media up loader. I have created eight buttons and eight input text fields which should contain the url of the image that has been uploaded. The click event is not being fired, probably because Wordpress outputs the HTML twice(Once in the bar of the available widgets and once in the bar currently active widgets). Does anybody sees what I'm doing wrong? Below you find my code. Thanks in advance for the help! <?php /* Plugin Name: Home_Rollover_Widget Plugin URI: Description: Home Rollover Widget

Good resources for Wordpress? [closed]

非 Y 不嫁゛ 提交于 2019-12-02 16:53:41
I'm building quite a large site, no e-commerce, but a a lot of specific content to be managed. For some reason, the client wants Wordpress. There is no way of getting around this... I've used Wordpress before to rapidly develop blogs, but that's about it. If anything goes beyond the scope of Wordpress I'll use a framework in something (Rails/Cake). This build is going to require custom plug-ins and widgets, so what I'm asking is how is the best way to go about learning how Wordpress and best practices for plug-ins and widgets? hsatterwhite I use these on a daily basis and all the links are

WooCommerce - where can I edit HTML generated by hooks?

流过昼夜 提交于 2019-12-02 15:12:17
I'm new to WooCommerce. Anyhow, I want to create my own theme, so I followed the guidelines and copied accross the core template files to /mywordpresstheme/woocommerce/ . That all works great and I'm editing the templates just fine. However, the way hooks and actions work in WooCommerce is baffling me and I can't work out where certain parts of generated HTML are coming from. For example, in content-product.php , there is a hook that gets the image: <?php /* * woocommerce_before_shop_loop_item_title hook * * @hooked woocommerce_show_product_loop_sale_flash - 10 * @hooked woocommerce_template

Get post ID of current logged in user and add a link to the menu

旧时模样 提交于 2019-12-02 13:27:38
I am using a plugin called wp job manager, which creates "jobs" as wordpress posts. I am limiting the number of jobs a user can have to one and would like to add a direct link to their job in the navigation menu. I would also like to add a edit link, which is dynamically generated using the post id of the job. Seeing as though users will only have one post , I believe this is do-able. Edit: If I can even just get a link to the single post of the current logged in user and add it to the menu, I believe I can add the edit link inside the post itself. The edit job url is created dynamiclly like

Using wp_mail() instead of mail() in Wordpress does not work

吃可爱长大的小学妹 提交于 2019-12-02 11:43:25
问题 Since PHP mail has been disabled on my server it has stopped a theme integrated contact form from working. The theme is called Boldy and it has its own sendmail.php file which uses mail() instead of wp_mail() . Changing mail() to wp_mail() does not work, but I'm not sure why? <?php if (isset($_POST['submit'])) { error_reporting(E_NOTICE); function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } if ($

Using jQuery trying to change background-color of text box but not working in wordpress

旧巷老猫 提交于 2019-12-02 11:39:24
问题 Here is jQuery code which I am using . <input class="jscolor" name="jscolor" value="F078A0" /> <input name="my_txtbox" type="text" id="my_txtbox_id" value="F078A0" /> <script type="text/javascript"> jQuery('.jscolor').on('change', function($) { var color = jQuery('.jscolor').val(); jQuery('#my_txtbox_id').text(color); jQuery('#my_txtbox_id').attr('value',color); jQuery('#my_txtbox_id').css('background-color',color); }); </script> I put this in my plugin function file #my_txtbox_id get value