ciantic
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How To Activate a jquery ui dialogHere is how to use it since it is now included:
PHP:
wp_enqueue_script('jquery-ui-dialog');
wp_enqueue_style("wp-jquery-ui-dialog");
JS:
var dlg = $("<div id='myFancyDialog' />")
.text('content')
.appendTo("body");dlg.dialog({
'dialogClass' : 'wp-dialog',
'modal' : true,
'autoOpen' : false,
'closeOnEscape' : true,
'buttons' : [
{
'text' : 'Close',
'class' : 'button-primary',
'click' : function() {
$(this).dialog('close');
}
}
]
}).dialog('open');It’s one ugly monster, I hope WP peeps improve the look of it. X-closing thing looks like from outer-space, borders are outstandingly horrible too.
Forum: Fixing WordPress
In reply to: Empty slug for rewrite?Ah found the official answer: Don’t do it, instead if you must set rewrite = false and write your own rewrite.
https://core.trac.www.ads-software.com/ticket/15082
Now I must discover how to do this custom rewrite.
Forum: Fixing WordPress
In reply to: Empty slug for rewrite?If I set hierarchical to false and slug to
/
it kinda works, but it page links doesn’t work anymore.Must test more.
Forum: Fixing WordPress
In reply to: Empty slug for rewrite?I tried to circumvent this by doing like this:
class NonEmptyString {
public function __toString() {
return '';
}
}...
'slug' => new NonEmptyString()
It gives 404 and seems to fail just like the
'/'
. Hmm, what is this 404 I keep getting then.Forum: Fixing WordPress
In reply to: Empty slug for rewrite?Evidently this empty slug cannot work, if one looks at the source code Line 991 in wp-includes/post.php (3.2.1):
991 if ( empty( $args->rewrite['slug'] ) )
992 $args->rewrite['slug'] = $post_type;Now same part of code in 3.0 was like this:
https://core.trac.www.ads-software.com/browser/tags/3.0/wp-includes/post.php#L865
865 if ( !isset($args->rewrite['slug']) )
866 $args->rewrite['slug'] = $post_type;Why was it changed to empty? Now one cannot use ” anymore. Argh!
Forum: Hacks
In reply to: How can I create a custom post type with empty slug?I get 404 if I put
'/'
to the slug in 3.2.1, how to do this now then?Forum: Fixing WordPress
In reply to: using locate_template for javascript/cssThat was before I had found out the amazing API functions:
wp_register_script, wp_enqueue_script, wp_localize_script
If you ever consider something I did at first, then you are doing it wrong, check those functions first.
Forum: Fixing WordPress
In reply to: using locate_template for javascript/cssIn fact the actual code I ended up using is this:
<script type="text/javascript" src="<?=home_url()?>/<?=substr(locate_template(array('js/3col-shelf.js')), strlen(ABSPATH));?>"></script>
Still looking for native way to do this!