Tag Info

New answers tagged

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

If you prefere to have those values editable at any time perhaps you could use this lightweight plugin http://wordpress.org/plugins/wp-smtp/


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'; ...


0

This post might solve your problem as it defines each and every aspect of SMTP configuration


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

There might be that the _visibility post_meta not set when the import was made: update_post_meta($post_id,'_visibility','visible');


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 ...


0

Transferring things between "admin" and "user" sides is rarely trivial. Admin side uses admin pages, front side uses theme templates. The context (conditionals, some of the hooks, presence of main query) are different. Elaborate plugins often purposely target either side for [parts of] their functionality. So in general you would need to: Adjust or ...


0

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


0

You are using Ubuntu package for WordPress right? Had you tried conventional install (just downloading official WP archive and setting it up with LAMP)? While it's not very "Linux way" maybe, it's commonly suggested to stick with that for WordPress. I briefly dealt with Ubuntu WP package in the past and ended up doing just that as well. PS if that 3.8.2 ...


0

I know how to get all categories with get_categories I think you've missed some of the arguments in get_categories. By default, empty categories (categories without posts) are hidden 'hide_empty' => 1, To get categories without posts, simply set hide_empty to 0 'hide_empty' => 0, Here is an example $categories = ...


3

For the fun of it, straight from the plugin page. This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page. The truth of it, ...


1

It shows how simple create plugin for WordPress.


0

You can remove the else statement so that user will see the message and will be able to upload csv again or you can redirect using echo '<script>windows.location.href="' . $url . '"</script>'; die; Edit $admin_services = add_menu_page( 'Fee Schedule', 'Fee Schedule', 'administrator', 'pd- services', 'pd_services' ); function pd_services() { ...


0

This turned out to be an issue between a php.ini file in my wordpress installation and the system's php.ini file. Wordpress will use the one in its directory and ignore everything in the system php.ini file. Deleting the wordpress php.ini file fixed the issue.


0

Sounds like what you need is a page template. This will allow you to enter your PHP (and any other code) in the appropriate place to generate the content on the frontend. Starting with a copy of your theme's current page.php file is usually a good place to start. Modify the main area with your code, upload the file and select it as the page template in ...


1

Well, you could hook into the the_content filter, asking if it was a single custom post type and then replace the output with something you like. Something like this: function content_my_cpt_filter( $content ) { if (is_singular() && (get_post_type() == 'my_cpt')) { $returnage = $content; $returnage .= 'Other Stuff that needs to ...


0

You have misunderstand the purpose of add_submenu_page and it's callback function. If you take a look at Wordpress Codex you will see that the purpose of this function , in your case the slides_page function, is to output the content of the page. ie output HTML code etc $function (callback) (optional) The function to be called to output the content for ...


0

I think what you are looking for is: Create a template for your custom page 'slides.' Inside of that template, use WP_Query to call in your custom post type. Like so: <?php $loop = new WP_Query( array( 'post_type' => 'slideroo', 'posts_per_page' => -1 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); $do_not_duplicate = ...


0

You could check if the response doesn't work right, or if your jQuery-function is messing with it by inserting alert(response); in the first line of your success-function. This way, the responsestring will be shown in an alertbox.


0

Simple and easy. Taken from WP if ( ! function_exists( 'is_plugin_active' ) ) require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); and then any instances of if ( is_plugin_active( 'feed-them-social/feed-them.php' ) ) { } get the function check. SO no more errors.


0

Ok, here is a slightly more complete answer for those who stumble upon this later. add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { $fields['order']['language']['placeholder'] = ''; $fields['order']['language']['type'] = 'text'; ...


0

Regardless of your php settings, there is some script that is wither bad configured and it is eating up more resources that it should. Consider updating your plugins, and see what is happening with the "types" plugin. On your first error ( clicking pages ), the types plugin is where it stops. In the second, you are also trying to do something related to ...


0

For sending mass emails I wouldn't recommend sending them from your email program nor from WordPress; instead, I would recommend a third-party service that specializes in sending emails - in particular, I usually recommend MailChimp as they offer a free subscription level that is usually sufficient. They also provide a easy-to-use WP plugin that allows ...


0

Provided that your server receives data in the form of a string which it should if you're using the jQuery serialize() function. It will be something like: name1=value&name2=value&name3=value You just need to parse the string into an array as follows: $parameters = array(); parse_str($_GET, $parameters); See the following for more information: ...


1

I believe renaming the plugin file/folder should be enough; if not, you can also edit the plugin info in the header of the plugin file and set the version to something unreasonably high. On the rare occasion I've needed to do this, I usually also update the plugin info to indicate that the plugin has been modified from the original (and why, if it can be ...


0

You can remove it from the submenu array: function add_my_menu(){ global $submenu; add_menu_page( 'Main Menu', 'Main Menu', 'manage_options', 'main-menu-settings', 'main_menu_settings'); add_submenu_page( 'main-menu-settings', 'Sub Menu', 'sub menu', 'manage_options', 'sub-menu', 'sub_menu_settings'); unset( $submenu['main-menu-settings'][0] ...


0

If you use admin_init no text should be output in the file unless you have some php notice. Edit: The following code should do. <?php /** * download_custom_taxonomy_csv_154304 */ add_action('admin_init', 'download_custom_taxonomy_csv_154304'); function download_custom_taxonomy_csv_154304 () { // Check for GET request if ( isset( ...


0

As indicated elsewhere, this is actually part of the WMPL plugin. To turn it off you can simply deactivate the additional installer plugin which is used to keep WMPL -and other 3rd party apps- up to date.


0

That is part of WPML's functionality to check for known incompatibilities with 3rd party plugins. To my knowledge, there is no way to toggle that off.


0

Ok i got it. The solution is to use an earlier hook for checking plugins. But then the function get_plugins() is not available so i have to include it for using. The working code: class acf_multisite_sync { function __construct() { add_action('plugins_loaded', array($this, 'acf_sync_init')); } function acf_sync_init() { if ...


1

The basic building block of WordPress templating is template tag, that is function echoing (the_*()) or returning (get_*()) specific information. It's no that far off from other kinds of templating, the largest difference is that WP "context" is typically much larger, way less contained, and rarely controlled by developer directly much. Form workflows in ...


0

If a plugin is written well (or the theme) than you have no reason to worry about duplicate jquery loading. if your theme uses header.php to load jquery then your doing it wrong and should use enqueue scripts to load jQuery... Wordpress uses wp enqueue script to declare scripts once and not multiple times. Example of loading scripts the right way: ...


0

Note the parameter rules of both register_post_type: $post_type (string) (required) Post type. (max. 20 characters, can not contain capital letters or spaces) and register_taxonomy: $taxonomy (string) (required) The name of the taxonomy. Name should only contain lowercase letters and the underscore character, and not be more than 32 characters ...


0

If you take a look at the category parameters of WP_Query, you'll see that you can use either cat=-12 or category__not_in' => 12 to exclude a category with ID 12 in your custom query. I just also want to point out a few things here. showposts is depreciated, you should be using posts_per_page. Also 'showposts=6' . '&paged='.$paged is wrong. You ...



Top 50 recent answers are included