Tag Info

New answers tagged

0

After some researches I came across two plugins using WebRTC : Collaboration, which is a simple integration of TogetherJS wpRTC which is not enough mature yet but look promising !


0

I think here is something which can help you. Some hooks which work when WordPress core is upgraded. Is there a Wordpress core & plugins update action hook?


1

First of all, the_content is a filter hook and not action. Secondly, it will only work when post content will be access on your site front end. You can probably make use of global variables instead. e.g. $options = get_option( 'wpglobalsettings' ); and then use wherever you want to access as follows - global $options;


0

Because your $options variable is limited to just the scope of the wp_global_settings_frontend() function. What you want to do here is set it as a constant instead of a local variable. function wp_global_settings_frontend(){ define('OPTIONS', get_option('wpglobalsettings'); } add_action('the_content', 'wp_global_settings_frontend'); ...


0

I did not test this, but something like this should work. Edit the function all_js in your plugin file and add these lines: $.post("/wp-admin/admin-ajax.php", { idPost: $(".post-read").data("id"), action: "read" }, function(response) { // Handle errors etc. }); You also need to ensure that the button data changes when the AJAX request is made. Here ...


0

As Mark explained, you will need to return $newvar. That should work. Also, please reset the permalink once. (I mean, go to Permalinks section in dashboard and click 'Save changes' button without making any changes. It will flush rewrite rules and build them again.) If it still does not work, then I think below snippet may help. Check if that works. I ...


0

Yes, There is a Wordpress voting plugin. Please Visit http://plugins.ohiowebtech.com/downloads/wordpress-voting-photo-contest-plugin/ for details


0

Simple workaround would be to add FTP credentials inside wp-config.php file, like this: define( 'FTP_USER', 'username' ); define( 'FTP_PASS', 'password' ); define( 'FTP_HOST', 'ftp.example.org:21' ); But the problem might be related to your hosting using some different PHP process instead of suPHP.


0

This probably has something to do with the way your hosting company had configured their mail sending utilities that php is using. As an alternative you can try to use one of the plugins which enable you to send mail via SMTP


0

I have added a wrapper to your html output and then written a jQuery code that you can use - function embed_url() { $dropdown_menu = '<select><option>OptionDefault</option><option value="?id=1">Option1<option value="?id=2">Option2</option></select>'; $full_url = '<object type="text/html" data=' . $embed_this_url ...


1

For reference, you may want to read the update_option documentation. The arguments you are passing are completely unrelated. However, your third technique is the closest, you have to update all the options in the the update_option call, not just the one option you want. This is because of how the plugin is storing it's options as an array rather than ...


0

One thing to take into account, NAME is a reserved wordpress word, if you use a field called name, when you submit your form, you will obtain a 404 not found error.


2

I think those of us who have been working with Wordpress for a few years have been guilty of doing this at one stage or another. I have had to make modifications to a plugin that was no longer being supported by the original author and had some compatibility issues with later versions of Wordpress. There are situations where editing an existing plugin ...


0

I think you need to set a default value when you use get_option function plugin_setting_url() { $options = get_option('plugin_options', array('embedded_url'=>'')); echo ""; } Unless plugin_options already exists, then you would need to use wp_parse_args to merge two arrays. function plugin_setting_url() { $options = ...


1

Template filters have to return the name of a template file, not content. Their purpose is to override template selection with a different template. If you want to modify the content output within the content of a template, then you need to add a filter to the_content. function my_the_content_filter( $content ) { global $post; if ...


5

In general you don't want to modify plugins, because you will loose your modifications next time you update them. It's a little bit different for themes, where you can set up a child theme. If the plugin is using the wp_mail() function to send out the emails, you might try to use the wp_mail filter to change the recipients. Try to write your own plugin to ...


4

The most important question which you must ask yourself is Am I the author of the theme or plugin?. If your answer is yes, and you are responsible for the up keep of the plugin or theme, go ahead and change it and modify as you like. If your answer is no, then you should not make any changes to it, not even a small thing as a simple dot .. The same goes for ...


0

I know it's an old question, in case anyone is still looking -- you don't have to activate jetpacks mobile theme module to access the mobile detection built into the plugin, no need to edit the jetpack plugin files, keeping things much more update safe. //load JetPack Mobile Detection $detect = new Jetpack_User_Agent_Info(); print_r($ua_info); //Check if ...


0

Sometimes i find wordpress can be quite finiky when it comes to referencing files within the plugin. Specifying a full path seems to fix the problem. Try replacing... market_admin/icon.png With... /wp-content/plugins/your-plugin-name-goes-here/your-file-name-goes-here.png


0

Maybe this isn't the best method because it does give an editor access to Settings and Options, but what this does is gives the a specific editor (based on user ID) the permissions to edit options. We then test if we're loading one of the options template, if we are AND the user id is the same id we've given permissions to, kill the process and spit out a ...


0

Your are pointing to a non existing AJAX file. $.ajax( { // ... url : '/path/myfile.php', // ... } ); WordPress has a predefined file for that: admin_url( 'admin-ajax.php' ) When you are running public queries, then you need to add it to wp_localize_script( 'your-script-handle', 'yourJavaScriptAccessibleObject', array( 'ajaxurl' ...


0

The file testimonial_archive.php is not a valid WP template if you don't define a custom way to use that file. The expected name is cpt-archive.php, in your case astestimonial-archive.php. Also, instead of using file_exists, you should use locate_template() to take adventage of template hierarchy and compatibility with child and parent themes. ...


3

First, like many things in WordPress, it's not like someone decided "let's make this neat and convenient". It was more like someone slapped it together for something, then it got used more in admin, then it got used a lot in admin, then it became kind of practice to use it for non-admin as well. Or something along these lines. Second, it's not as much what ...


0

There's at least 3 options to choose from: You can use the single CPT file name which you can grab from the source code in the body classes or a custom class which can be added directly to the single-cpt.php file or using a functions file with conditional tag. .single-cpt { your declarations } Or add directly to single-cpt.php file add_filter( ...


0

You can riff off of how WooCommerce and other plugins are providing templates in their plugin, while allowing the theme to override them if they exist. Basically, you hook into the template_include function, which is where WordPress decides what template to load for a given query. Since you want to do something with the author.php template, you will want ...


0

You could provide your editors textarea's ID to get the content of the tinyMCE, also you should get the contents of the saved post meta and set it as the text of your editor element to display the value saved before. You could use the following code as a reference, <?php function taggr_meta_function($post){ $my_editor = get_post_meta($post->ID, ...


0

Add below hook to your theme function.php file add_action( 'pre_get_posts', 'custom_pre_get_posts' ); function custom_pre_get_posts( $q ) { if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! is_admin() && is_shop() ) { $q->set( 'tax_query', array(array( 'taxonomy' ...


0

Use this css classes in wpp.css file : .wpp-list { float: left; } .wpp-list li { float: left; width: 50%; } .wpp-post-title { float: left; width: 100%; } and this style float: left;width: 100%; to image anchor tag


2

I got the following tutorial a very good start for a widget creation: How to Create a Custom WP Widget — WPBeginner And I used the tutorial and made my own first widget for my plugin. You can get all my code here in Github.


0

You forgot to declare global $post //Create Meta box function astest_add_metabox() { add_meta_box("astestimonial_metaboxes", "AS-Testimonial Client Information", "astestimonial_meta_box", "astestimonial", "side", "low"); } add_action('add_meta_boxes','astest_add_metabox'); //html code function astestimonial_meta_box() { global $post; ...


0

Figured it out. $post_obj['permalink'] = my_getDraftPermalink( $post_obj['post_id'] ); That's the correct syntax for getting the post_id. Then a custom function that gets the permalink the same way as the post dashboard UI is required. The dashboard uses get_sample_permalink and not get_permalink, which will return the draft path if the post isn't live. ...


0

I had a similar issue, and it turned out to be a very outdated version of jQuery that I was enqueueing. You may wish to make sure that your Wordpress install and the subsequent jQuery file it includes is up to date, or if you enqueue from google like I do, make sure that's up to date.


2

lets say we're registering 3 post types: is it worse for performance to do this in 3 different plugins (one for each post type), than registering all 3 in one plugin? in other words, is using an extra plugin adding to the load time, even if it doesn't do anything? The technical process of plugin load is a simple PHP include. So there is no significant ...


0

Another thing to check is that if we enable comment or not. If the comments_template() is not called, then the facebook comment box does not show either


0

You need to add the prefix wpcf-. I mean that wpcf-source


0

We got it working. We used a plugin called the Javascript & CSS toolbox to store our individual code blocks and then we put the html code in the page content pane and it worked brilliantly.


0

Well.... you could use the correct Field in the $_POST, which would be $_POST['post_id'], not $_POST['post-id'] ;) Replace update_post_meta($_POST['post-id'], 'whole_avg',$whole_avg); with update_post_meta($_POST['post_id'], 'whole_avg',$whole_avg); etc. ;) Happy Coding, Kuchenundkakao


1

Wordpress looks for the Plugin Header in the php files. The main Plugin file should have a header like this: <?php /** * Plugin Name: Name Of The Plugin * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates * Description: A brief description of the Plugin. * Version: The Plugin's Version Number, e.g.: 1.0 * Author: Name Of The Plugin Author ...


1

So, how to have the flexibility to pass variable into any Wordpress' action/filter and while maintain the flexibility to cancel them later? You could assign the function to one of the class's properties: public function __construct() { $foo = 'bar'; $this->init_func = function() use ( $foo ) { echo $foo; }; add_action( ...


0

Wordpress uses PHPMailer class and has an action hook that you can use to configure it. For example: add_action( 'phpmailer_init', 'cyb_smtp_config' ); function cyb_smtp_config( $phpmailer ) { $phpmailer->IsSMTP(); $phpmailer->Host = 'smtp.mailer.com'; $phpmailer->Port = 25; $phpmailer->Username = 'username'; ...


1

One way could be to use classes and objects. It's more efficient considering reusability, collective work and more. I don't think it's bad to use global variables if you know what you're doing. So I would recommand you to use OOP (object oriented programming) especially with inheritance and polymorphism.


0

What host service are you using? I had the same issue using Dreamhost, where you can adjust the memory limit for the server you are using on the hosts panel. Doing this solved the issue for us. Also, a possible issue could be your SQL server, switching to another SQL server may resolve your issue. Contact your host for more info.


1

If you can use the backend to install plugins, you can try to use the plugin backwpup: https://wordpress.org/plugins/backwpup/ it does a complete backup of your site in a folder or to a cloud-service like dropbox. Also, it provides an own compression unit so if pclzip is deactivated, you can still use tar ^^


1

Without FTP access, if you have an administrative login to the WordPress admin you can grab the code from plugins and themes one file at at time. For themes go to Appearance > Editor For plugins go to Plugins > Editor Select the appropriate theme / plugin and go through the list of files downloading the code, css, etc. This will not have the images, but ...


1

Finally figured it out. Using the plugin mentioned above (linked here for ease) and the basics of the answer to this question I was able to cobble together this code It's a bit hamfisted, I'll admit that (mainly replacing the preg_match with strstr) but it got the job done. I'm open to any improvements you all can think of so please feel free to comment ...


0

With the new Wordpress version, the jQuery library is already added. You can review the wp_register_script function. Othersie, I think here the issue is your link. You need to review the plug-in urls. function my_admin_script($hook) { if ($hook != 'widgets.php') return; wp_enqueue_media(); wp_register_script('my-admin-js', ...


1

Your path have an extra _ in between widget-plugin.php and /js/upload.js. BTW, your path should just be plugins_url( '/js/upload.js' , __FILE__ ), Go and check the following wp_enqueu_scripts wp_enqueue_script wp_register_script admin_enqueue_scripts


1

It's probably due to an unclosed curly brace somewhere. Can include more code? The line numbers in the error message are not always where the actual issue is.


0

First, let me say that there is no web application 100% secure. That being said, you are using the nonce correctly. The function you are using, update_post_meta(), will sql-scape the data as it uses insert/update methods of wpdb class. So, there is no risk for most common security problemas. What you should take care, I think, is data validation, and you ...


1

function HSA_add_to_menu() { add_options_page('Horizontal scrolling announcement', __('Horizontal Scrolling', WP_hsa_UNIQUE_NAME), 'edit_others_posts', 'horizontal-scrolling-announcement', 'HSA_admin_options' ); } http://codex.wordpress.org/Roles_and_Capabilities#Editor



Top 50 recent answers are included