Andy Potanin
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Password Protect Page – Custom TemplateIn case you are looking to modify the generic “This post is password protected. To view..” form, you can add a filter into the functions.php file, like so:
<?php add_filter('the_password_form', 'custom_the_password_form'); function custom_the_password_form() { $output = 'YOUR CUSTOM FORM AND TEXT HERE'; return $output; } ?>
You can view the original code in post-template.php on lines 1132 – 1141.
Forum: Fixing WordPress
In reply to: Password Protect Page TemplateIn case you are looking to modify the generic “This post is password protected. To view..” form, you can add a filter into the functions.php file, like so:
<?php add_filter('the_password_form', 'custom_the_password_form'); function custom_the_password_form() { $output = 'YOUR CUSTOM FORM AND TEXT HERE'; return $output; } ?>
You can view the original code in post-template.php on lines 1132 – 1141.
Forum: Fixing WordPress
In reply to: Repeatable loss of functionality with specific pluginsJavaScript (jQuery) issues are fixed in the most recent release (1.9.3)
Forum: Plugins
In reply to: Which one is the original, Web Invoice or WP Invoice?The original WordPress invoicing plugin is WP-Invoice, this can be seen at the respective plugins’ Stats pages – WP-Invoice was launched on December 31st, 2008. While “Web Invoice” was launched over three months later.
The “developer” of Web Invoice never contacted us, the original developers, asking permission (out of common courtesy, perhaps) to modify our plugin and re-distribute it.
We contacted the”author”, asking him to either take down the plugin, or give us noticeable credit, but to no response.
Although we encourage user modifications for personal use, we believe that a public re-release of copied code is questionable in character, especially when the “modifications” are centered around inserting one’s lucrative affiliate links.
TwinCitiesTech.com is a respectable company, and we have continued to improve and support WP-Invoice requests throughout the months, as may be seen at our UserVoice page – https://wpinvoice.uservoice.com We’ve acted upon, and implemented over 30 user-originated suggestions.
So if you are interested in additional modifications to the original plugin, while working with the original developer, feel free to contact us: https://twincitiestech.com/contact-us/
Thank you.
Forum: Plugins
In reply to: jQuery and jQuery UIAnother thing to consider – update your jQuery (or whatever your library of choice is) files.
Download the latest jquery library, ui, effects, etc. and unpack them into wp-includes/js/jquery
This fixed a number of my compatibility issues with different plugins.
Forum: Plugins
In reply to: jQuery and jQuery UII encounter this problem quite often. One thing I noticed that may help others:
Let’s say I am trying to include a script called colorpicker.js
The “proper” way of including scripts is using “wp_enqueue_script”, like this:
wp_enqueue_script(‘colorpicker’, “/js/colorpicker.js”,array(‘jquery’));
HOWEVER, doing this will cause various problems, the reason behind this is WordPress decides to load the prototype library since “colorpicker” is associated with it.
Keep your eye open for this, it’s best to use a standard such as:
wp_enqueue_script(‘jquery.colorpicker’, “/js/colorpicker.js”,array(‘jquery’));
Good luck.
Forum: Themes and Templates
In reply to: change bloginfo and customizing a stylesheetPerhaps this is a better example:
add_filter(‘stylesheet_uri’, ‘change_css’);
function change_css() {
return get_bloginfo(‘template_url’) . ‘/my_custom_stylesheet_name.css’;}
Forum: Themes and Templates
In reply to: change bloginfo and customizing a stylesheetIf you want to actually change it:
Add the following code to your functions.php file.
add_filter(‘stylesheet_uri’, ‘change_css’);
function change_css() {
return “https://website.com/yourcssfile.css”;
}WordPress loads the functions.php file prior to loading the template files. The add_filter we use here modifies stylesheet_uri, so when it gets called within your template, it will be the path you specified.
You can do this with most bloginfo variables.
View wp-includes/theme.php if you are curious what else can be modified, anything with “apply_filters(“whatever”)…..” can be modified, just replace whatever with what you’re modifying in your add_filter.
Good luck
Forum: Requests and Feedback
In reply to: Custom FIeld page (with file upload)cformsII could do most of this, if not all. you may need to write some custom code to display the data on the second page, but their api is very good and easy to understand.
Forum: Plugins
In reply to: need plugins directory constant compatible with 2.5 and 2.6Thank you, exactly what I needed.
Forum: Plugins
In reply to: wp-invoice error (wp-settings.php on line 473)That was a temporary issue, the plugin wasn’t uploaded correctly to the repository. The correct version is now uploaded and fully functional.
Thank you.
Forum: Plugins
In reply to: attachment fields as image meta data?I modified the above script, I had to give a client the ability to organize images within media library into certain categories, which are used later in the template to assist with layout.
Ive only tested this script on 2.7, and it is very rough, but perhaps will help somebody.
Keep in mind, you have to specify which categories you want to make available within the code, if this were made into a plugin there are much better ways of doing it.
add_filter(‘attachment_fields_to_edit’, ‘ms_attachment_fields_to_edit’, 11, 2);
add_filter(‘attachment_fields_to_save’, ‘ms_image_attachment_fields_to_save’, 11, 2);function ms_attachment_fields_to_edit($form_fields, $post) {
// Define categories we want to use
$category_array[“gallery_block_1″]=”Front Page Gallery Block 1”;
$category_array[“gallery_block_2″]=”Front Page Gallery Block 2”;
$category_array[“gallery_block_3″]=”Front Page Gallery Block 3”;
$category_array[“gallery_block_tall”]=”Front Page Gallery Tall Block”;$post_id = $_GET[‘attachment_id’];
$meta = wp_get_attachment_metadata( $post_id );
$image_gallery_folder = $meta[‘image_meta’][‘image_gallery_folder’];$draw_gallery_folder_dropdown = “<select name=’image_gallery_folder’ id=’image_gallery_folder’>”;
foreach ($category_array as $key => $value) {
$draw_gallery_folder_dropdown .= “<option “;
if($image_gallery_folder == $key) $draw_gallery_folder_dropdown .= ” SELECTED “;
$draw_gallery_folder_dropdown .= “value=’$key’>$value</option>”;
}
$draw_gallery_folder_dropdown .=”</select>”;if ( substr($post->post_mime_type, 0, 5) == ‘image’ ) {
$form_fields[‘image_gallery_folder’] = array(
‘label’ => __(‘Image Folder’),
‘input’ => ‘html’,
‘html’ => $draw_gallery_folder_dropdown
);}return $form_fields;
}function ms_image_attachment_fields_to_save($post, $attachment) {
if ( substr($post[‘post_mime_type’], 0, 5) == ‘image’ ) {
$attachment_id = $post[‘ID’];
$meta = wp_get_attachment_metadata( $attachment_id );
$meta[‘image_meta’][‘image_gallery_folder’] = $_POST[‘image_gallery_folder’];
wp_update_attachment_metadata( $attachment_id, $meta );
}
return $post;
}Forum: Plugins
In reply to: wp-invoiceste1988, please contact me at https://twincitiestech.com/contact-us/
This is something I may be interested in developing, and would appreciate any input you have to offer.
Forum: Plugins
In reply to: add_action admin_menu viewable by all users?Here’s an example:
add_menu_page(‘Web Invoice System’, ‘Web Invoice’, 6, __FILE__, ‘wp_invoice_options_page’);
The 6 is what determines minimum user level to see the plugin in the menu. Then there may be additional current_user_can() conditional statements within the plugin.
Forum: Plugins
In reply to: E-Commerce Billing SystemWP-Invoice isn’t “automated”, but it lets you send bills/invoices to your clients: https://twincitiestech.com/services/wp-invoice/