Tag Info

New answers tagged

0

I question the wisdom of extending a class from another plugin. You have no idea what will happen next time that other plugin gets updated. However, generally speaking you can control when in a hook "queue" a function runs by passing a third parameter-- a priority. So pass a priority high enough and your function should run after the other plugin's ...


0

Another buyer has created this snippet https://gist.github.com/Davidlab/5134645 The proper way is to define('NGG_SKIP_LOAD_SCRIPTS', true); Note that this'll be included in the next version of my plugin.


1

Shortcode is definitely a good start. It is very flexible in terms of where you output the content (widget, post, page, inside php function, etc). You can also override the template output easily by using action hooks and custom post type that you create: add_action('the_content', 'add_project_content'); function add_project_content($content) { // ...


0

Here's a slimmed-down version of what I usually do. Replace wpse100645 with whatever you want, but be respectful of the fact that you don't want to interfere with a site's content. <?php /** * Create a custom path and process code when it gets triggered * * @author Matthew Boynes */ if ( !class_exists( 'WPSE_100645_Custom_Page' ) ) : class ...


0

It depends entirely on your long-term goals, which evidently include a project management tool. If you want to mock something up and have it working soon it's probably best to just grab Twitter Bootstrap, some PHP framework (Codeigniter, Yii, etc.) and have something working in a week or two. If you want something more stable, something more mature and ...


0

Just add below css in your style, ul ul { margin-left: 1.5em; } Output:


0

I've solved it with hard coding. I know, it isn't a great answer, but there was no other choice. Redirecting this plugin wasn't possible.


0

Use the stack exchange API http://api.stackexchange.com/docs along with WordPress' HTTP related functions: http://codex.wordpress.org/HTTP_API wp_remote_get() - http://codex.wordpress.org/Function_API/wp_remote_get wp_remote_retrieve_body() - http://codex.wordpress.org/Function_API/wp_remote_retrieve_body ... and finally cached for good measure.


2

There is no need for a custom table here - you can use the user metadata table and API. Then create a WP-Cron job to run every 24 hours (or more frequently if you're paranoid). On the callback query users who've registered in the last 7 days using something like: /* * Get all users registered after $start and before $end (dates in yyyy-mm-dd format) * ...


1

Use an RSS feed widget and grab the RSS feed of the SE site. In the case of this site: http://wordpress.stackexchange.com/feeds/


0

The check is invoked after a call to get_option( 'wypiekacz_allow_skip_rules' ). When you filter pre_option_wypiekacz_allow_skip_rules and returns something different than FALSE, it should stop the check early. Not tested. add_filter( 'pre_option_wypiekacz_allow_skip_rules', 'wpse_100503_wypiekacz_for_drafts_only' ); function ...


7

We just committed a new function to Jetpack Trunk, and it should be enabled in the next release, Jetpack::is_module_active() -- http://plugins.trac.wordpress.org/changeset/716884 Then you can just call: if( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'contact-form' ) ) {} Or at least, you will once the next version releases, and the user ...


0

This is a CSS-related question, more than a Wordpress related one. In your case all the rules that apply for normal CSS overriding are usable to solve your problem: Cascade: Apply the rules with the same specificity (same number and types of selectors) after the rules written by your plugin. The way to achieve this depends on which hook your plugin uses to ...


0

You're trying to send a redirect header on the admin_menu action, which is fired after some of the page has been sent to the browser. You have to hook an earlier action before output starts, like init. add_action( 'init', 'wpa_test' ); function wpa_test() { if(isset($_POST['submit'])) { wp_redirect( home_url() ); exit; } }


0

Perhaps the error was the trailing slash at end of my string (www.domain.com/new-name), because in the content I had links such as www.domain.com/old-namewpcontent/uploads/2013/05/image.gif. Undo the changes didn't worked. I tried to install a fresh copy of Wordpress in the new folder and take over all files, theme and database tables. This didn't worked. ...


0

Your question makes it seem like you are using relative URLs-- "I used the path for the images like this: images/image.jpg ..." Don't use relative URLs in WordPress. Relative paths are not reliable, except in stylesheets. They do work in stylesheets. Use functions like admin_url and these other related functions.


2

You can't "override" whole files or functions, except in special circumstances. That is basic PHP. WordPress has code in place that will let you override particular files and functions. For example, child themes can override parent theme files. That is because of the way the WordPress Template loader works. The override only works if the files load via ...


0

Hooks are a way to override core files Or Write your own Shortcode and remove default one. shortcodes.php is a simple set of functions for creating macro codes for use in post/page content. like [gallery]


0

This usually indicates a problem with your hosting service and PHP sessions which Jigoshop is dependant on. If you check Admin->Jigoshop->System Info ... what is the 'session save path' set to? It should be something like /tmp although it could be something else. It should not be /var/lib/php5 or anything like that.


1

Use wp_editor(). There are many configuration options; you have to read the source to get all of them. Example: $editor_settings = array ( 'textarea_rows' => 15, 'media_buttons' => FALSE, 'teeny' => TRUE, 'tinymce' => TRUE, 'dfw' => FALSE, ); $content = $get_option( 'your_option_name' ); ...


1

Sure you can do this with : $title = stripslashes( get_post_meta($post->ID, 'key', true) ); You just have to replace 'key' with the appropriate key. See the documentation


1

I found a soloution and what causes it. It was not really the delimiter that was the problem it was becasue a user made duplicate posts. Solution: Replace $notify_message .= preg_replace('#[\s]+#', ' ',sprintf( get_comment_meta($comment->comment_ID, 'title',1))) .' skrev:'. "\r\n" . $comment->comment_content . "\r\n\r\n"; With ...


0

Thanks to the comments I figured out that what I was trying to do wasn't exactly possible. The reason being POSTing data to a php page will send the POST data outside of the WordPress loop or "framework". Therefore the WordPress functions aren't loaded. A way around this is to require the wordpress files that contain the functions you want to use inside ...


1

Save the shortcode name in an option, and use that when you add the shortcode: add_shortcode( get_option( 'your_plugin_option', 'default_shortcode_name' ), 'your_shortcode_callback' );


1

You're POSTing the form to the validate.php file directly, so the WordPress code isn't loaded. Instead you need to POST the form to the current URL or the home_url or something like that, and then have the plugin intercept the data and act accordingly, so that the WordPress code is loaded before you use its functions.


0

As I understood you correctly you just want to rename 'kkpo_quote' and you have conflict. Not to have conflict try to replace all 'kkpo_quote' with same name, for example: if you replace 'kkpo_quote' with 'new_quote' in register_setting(KKPLUGINOPTIONS_ID.'_options', 'new_quote'); then make sure that you replace it with 'new_quote' where ever is ...


2

How we can do it in the near future ;-) When the dropbox-foldershare-hyno plugin becomes WordPress 3.6 ready, we can do this: add_filter('shortcode_atts_dfh','overwrite_dfh_atts',10,3); function overwrite_dfh_atts($out, $pairs, $atts){ if($atts['link']) $out['link'] = do_shortcode( sprintf( '[wp-members field="%s"]', esc_attr( $atts['link'] ) ) ...


2

You cannot use shortcodes like this. The parser would not read that like you want. But there is a workaround: Hijack the shortcode dropbox-foldershare-hyno, run the callback function for the wp-members on the link and pass the result to the original dropbox-foldershare-hyno callback. Sample code, not tested: // wait until the other plugins are loaded ...


1

Nested shortcodes only work in certain specific circumstances: Only enclosed shortcodes can be nested. In other words, the style of [shortcode] content [/shortcode]. Self-enclosing shortcodes like [shortcode attribute="foo"] cannot be nested. Even in that case, the outer shortcode must be set up properly by calling do_shortcodes() on the content that's ...


0

No need for this anymore. You can use the Template Builder in the settings of GD-Star Rating self. Scroll to the bottom right if you have clicked on "Builder" and add a new template. Choose your own settings and paste the function or shortcode in your, respectively, page via the backend or page via Wordpress. Solved.


0

SOLVED! I find that GET is not working at all! You need to use POST and in the form action you need to type this: action="<?php admin_url('options-general.php?page=DD_Awesome_Plugin/DD_awesome_plugin.php'); ?>" Damn! It's sometimes so hard to do simple task in WP ;)


0

<form method="get" action="do_it.php" enctype="multipart/form-data"> In the action part of your form you should include the php file that is responsible for processing that hidden form variable, when the form is submitted it will pass that information to the file you specify. Left blank it will post back to the current page you are on which is not ...


0

Use a redirect in your form handler: if (isset($_GET['do_it_hidden'])) { // some code to execute here wp_redirect( admin_url( "options-general.php" ), 303 ); exit; } The user will be redirected to a clean URL then and barely notice the short URL change. Or use a POST request to avoid a changed URL completely.


0

Thanks to webaware for their answer. Here's some copy/pasta for anyone looking for a quick start. This takes an entry ID and retrieves the lead and form from that. In this case I'm using the URL to pass the value. e.g. somedomain.com?entry=123. <?php $lead_id = $_GET['entry']; $lead = RGFormsModel::get_lead( $lead_id ); $form = ...


1

Always happens. I ask and immediately find the answer. The answer is in the 2nd plugin add a "priority" of 11 to the add_action command. This plugs that submenu right in there. Like this: add_action('admin_menu', 'admin_submenu', 11);


0

You could also convert X from INT to TEXT or VARCHAR inside MySQL. Or, you could cast X into a string and pad it (to the left) with a 0.


0

Take a look at the php sprintf and printf functions. $x = 12345678; printf('%010d', $x);


3

This question is borderline "not constructive", because it's going to solicit opinion rather than objective fact or expertise. That said: my opinion is: By default the Plugin should not touch user-generated content It would be considerate to offer a "delete content" checkbox option at uninstall


1

Are you adding the shortcode to the ACF custom field? If so, you have to run the content filter on it so that it parses shortcodes. Fortunately ACF has the option to do this with its WYSIWYG fields. Simply select "Run filter "the_content"?" in the field options.


0

The plugin makes use of those hooks on its own templates: /templates/single-product.php /templates/archive-product.php And to override the templates, you simply copy the files into your own theme and do your modifications. That being said, to add the hooks into your page.php template, simply do: do_action('woocommerce_before_main_content'); if ...


3

Just use the [embed] shortcode around your items. <ul> <li>[embed]http://www.youtube.com/link/to/content[/embed]</li> ...


2

There is bit of special filtering by WP_Embed class that turns standalone links into target for embedding: /** * Passes any unlinked URLs that are on their own line to {@link WP_Embed::shortcode()} for potential embedding. * * @uses WP_Embed::autoembed_callback() * * @param string $content The content to be searched. * @return string Potentially ...


2

is_plugin_active() expects just the base name of the plugin as parameter: So use: is_plugin_active( 'woocommerce/woocommerce.php' ); The function will use the option 'active_plugins' which is a list of plugins paths relative to the plugin directory already. On a multi-site installation it will search in get_site_option( 'active_sitewide_plugins') too. ...


1

I don't quite know what you mean by "include a theme" and you are talking about a potentially large and complicated project but I think you should be able to control the display of your plugin content with the template_redirect hook. function template_redir_wpse_99209($content) { // code or file include, for example // exit; } ...


0

When calling add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' ); use your investigative skills to see how it would be best to call an if(thisweretrue) add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' ); since I don't know exactly what your specific situation is. I actually was able to use your solution for setting up the ...


1

D'oh. I fixed it, but I'll leave this question in case others have similar problems. When copy/pasting various options into wp-config.php I accidentally included this setting, which I don't normally use: // Overkill but FYI: disallows installation/updating of any theme or plugin define('DISALLOW_FILE_MODS',true); That produces the described problem, ...


3

I'm the author of Easy Table. Add this to your CSS table.easy-table:after{content:" ";display:table} table.easy-table:after{clear:both}


0

You're getting this because you're running PHP 5.2 on your server. The plugin requires PHP 5.3. If it did not do this check, you would get an error when it tried to use a PHP 5.3 feature. I won't recommend a plugin as that would be offtopic and result in the question being closed ( hint: edit that out of your question ). The fix, is to upgrade to PHP 5.3, ...


4

You have the name parameters set to "$id" which means that they'll be things like "show_header_2" and such. You actually want them to be "second_section[show_header_2]" and similar instead, so that the array of settings is what you get back from the form.


1

It is possible to use custom post types and only some features WordPress adds to that API. In fact, this is the default: When you call register_post_type(), the default value for public is FALSE. No UI, no query var, no rewrite rules, list tables or public visibility. You can leave public => FALSE, turn on only the features you need and use your custom ...



Top 50 recent answers are included