somtam
Forum Replies Created
-
Forum: Hacks
In reply to: Separate terms not only with comma, but with others symbol alsoI found another important part of the problem.
The code that check the terms list is in
wp-admin > js > post.js
Only when the add term button is pressed all the data are sent by ajax.the code of post.js about the term is from line 16
tagBox = { clean : function(tags) { var comma = postL10n.comma; if ( ',' !== comma ) tags = tags.replace(new RegExp(comma, 'g'), ','); tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, ''); if ( ',' !== comma ) tags = tags.replace(/,/g, comma); return tags; },
Forum: Hacks
In reply to: Separate terms not only with comma, but with others symbol alsothanks to the firefox plugin I know that now the variable are not POST, but GET, see below:
admin-ajax.php?action=ajax-tag-search&tax=colors&q=sss
so I made a test where my purpose was to change the get $q value.
add_action( 'admin_init', 'som_divider_term' ); function som_divider_term(){ $_GET['q'] = 'hello'; }
This example didn’t work, and I can’t really understand why.
In fact the hook is exactly fired in admin-ajax, before the execution of the functions.Moreover var_dumping the global $wp_filters in the INIT hook doesn’t work, because return an error of headers already send.
thanks for helping.
Forum: Hacks
In reply to: Separate terms not only with comma, but with others symbol alsoHello,
I’ve just tried, but probably there’s something I miss. This is:
add_action( 'wp_ajax_add-colors', 'som_divider_term', 1 ); function som_divider_term(){ $_POST['newtagcolors'] = 0; $_POST["newcolors"] = 0; }
In theory this code would prevent the insert of every new custom term. But it doesn’t work. I still can insert the custom term.
Moreover I tried both “newtag” and “new” to be sure to catch the right array.
And is there a way to debug and see what’s happen?… i mean some echo or print_r inside that function didn’t work.thanks for helping!
Forum: Themes and Templates
In reply to: [Twenty Thirteen] Truncate post length on pagesHey zwrodgers don’t forget the Read More tool ( last icon up to the right in the edit toolbar ). With that you can exactly establish where you want the text to finish in the archive, index ecc…
thanks everybody!
this solved my problem:
function my_em_disable_gallery(){ remove_action('init','em_event_gallery_override_init', 1000); } add_action('init', 'my_em_disable_gallery');
Probably this is not an advertising post… the title is “Comments not shown in JetPack”… so?
Anyway for developer, the problem was that you must have the template file comments.php in your template, and then insert comment_form() in that file instead of the form tag, and not substitute it with comments_template(); where you have to call the comments block.
Forum: Plugins
In reply to: [Custom Upload Dir] Upload from the Media Panel and not from PostRight now to solve the problem i use this:
add_filter('upload_dir', 'my_author_dir'); function my_author_dir( $param ){ global $current_user; $mydir = '/' . $current_user->user_login; $param['path'] = $param['path'] . $mydir; $param['url'] = $param['url'] . $mydir; error_log("path={$param['path']}"); error_log("url={$param['url']}"); error_log("subdir={$param['subdir']}"); error_log("basedir={$param['basedir']}"); error_log("baseurl={$param['baseurl']}"); error_log("error={$param['error']}"); return $param; }
thanks!
Thanks, but the problem is that I don’t want them to show up in my, as an example, sidebar, where I have custom query.
thanks!Is there any hook or filter than can control the output of the share button?
I use many wp_query in my sidebar or somewhere else, so I need it.thanks!
Sorry I just find now…
Just call comment_form(); instead of comments_template();thanks!
Sorry I can’t figured out… in all my websites I call the comment section with
comments_template();
I don’t use any custom comment template file, only personalize with css few little stuff ( color, font ecc… )But it doesn’t show the new jetpack comment.
Do I do something wrong?thanks!
Forum: Fixing WordPress
In reply to: [WordPress] [Plugin: Jetpack] Remove share buttons from query postsI’m also in the same situation.
I used to make some wp_query in different part of the template, but the share buttons always come out, even if I use the_content() the_excerpt().I think there’s a simple hook or filter to avoid this and decide where the share bottons would be printed.
Need help ?? thanks!
Forum: Plugins
In reply to: [Custom Upload Dir] Upload from the Media Panel and not from PostBut author ( and editor ) can also have access to the media panel…
So I think it is correct to make it works on the media panel also… because, if not, we have to comunicate to them not to upload and use the media panel.
This my 2 cents…. anyway thank for the work you’ve done.Forum: Hacks
In reply to: get the attachment only if the post status of the parent is publishedok, this is where I arrived, and it works, but it makes one query for each attachment, so I think a high consuming method.
I go to alter the main query with pre_get_posts()
function my_show_tax_attachments( $query ) { if ( $query->is_tax('myTaxonomy') && $query->is_main_query() ) { $query->set( 'post_status', 'inherit' ); } } add_action( 'pre_get_posts', 'my_show_tax_attachments' );
then on the taxonomy-myTaxonomy.php template
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if($post->post_parent > 0) { $att_post_parent = get_post( $post->post_parent ); if( $att_post_parent != null && $att_post_parent->post_status =='publish' ) { print_attachment_preview($post); } } else { print_attachment_preview($post); } ?> <?php endwhile; else: ?> <h2>No Results</h2> <?php endif; ?>
There’s so a way to check it with the main query?
thanks!Forum: Fixing WordPress
In reply to: Delete the default page queryyes sure,
but what I understand is that with the function query_post I can overwrite some parameters.
My question was if is possible to reset completely the query, and not only overwrite or add. The purpose of all this questions is that I would like to make the server works little as I can. But probably if I reset all the query I’m going to touch others important stuff.. is it correct?thanks again!