Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Forum: Hacks
    In reply to: widget cannot call add_filter
    Thread Starter adrianboston

    (@adrianboston)

    ok, i used options
    options are set in the update function of the Plugin class

    class XXX extends WP_Plugin {
    
          function update( $new_instance, $old_instance ) {      /* Save the form changes here */
    	   $hooks = strip_tags( $new_instance['hook'] );
    	   $opts = array('hooks'=>$hooks);
    	   update_option('unique_option_nameXX', $opts);//put hooks into database
          }
    }
    
    //elsewhere in the main file, above or below. no matter.
    
    if ( is_active_widget(false, false, 'widgetname', true) ) {
       $options = get_option('unique_option_nameXX');//returns options.
       if ($options) {
          $post_hooks = explode(',',$options['hooks']);//comma separated values, if any                            
    
          foreach ($post_hooks as $hook)
          {
    	 if ($hook && function_exists($hook)) {
    	    add_filter($hook,  'filter_callback');
    	 }
          }
       }

    function filter_callback($content)
    {
    //do whatever to content
    return $content;
    }

    that is messy but does it.

    Forum: Hacks
    In reply to: widget cannot call add_filter
    Thread Starter adrianboston

    (@adrianboston)

    or get the widget instances from the widgetfactory

    Forum: Hacks
    In reply to: widget cannot call add_filter
    Thread Starter adrianboston

    (@adrianboston)

    ive thought about trying to load it early but that seemed to fail..
    aka

    add_action( 'plugins_loaded', create_function( '', 'register_widget("XXX");' ) );
    Thread Starter adrianboston

    (@adrianboston)

    Of further note, that test was conducted using IE8 by way of https://webpagetest.org set to the location, Dulles, VA

    Browser set to ‘Chrome Replay’ the jQuery download was even better at 283 ms, also from Dulles.

    Few samples were taken, so results may vary.

    Thread Starter adrianboston

    (@adrianboston)

    Thread Starter adrianboston

    (@adrianboston)

    im 99% certain this is a form problem with null checkboxes and not a WP problem.

    and solved it as such,

    <label><input name="isenabled" type="hidden" value="0" ><input name="isenabled" type="checkbox" value="1" <?php if (isset($options['isenabled'])) { checked('1', $options['isenabled']); } ?> /> On</label>

    (as noted, using an array $options for options)

    in other words, consider it solved

    Thread Starter adrianboston

    (@adrianboston)

    in the interest of preventing hours of wasted hours by fellow humans

    here is one solution.

    1. use a ftp client
    2. delete the offending theme in wp-content/themes
    – do not rename the theme. rename seems to cause trouble.
    – do not need to delete or rename wp-content/plugins. in fact, you may cause trouble if you do delete or rename plugins.
    3. check your blog. you should see your blog main page with the default theme. click on a posting. if you get a timeout on a posting. then your permalinks do not work.
    4. goto your blog/wp-admin control panel
    5. change Settings | Permalinks to default
    6. re-check your blog. this time you will not be using a Permalink so you will see the ?p=

    if you still get a problem then you may have had both a theme and plugin problem
    7. time to rename wp-content/plugins to wp-content/plugins_dammit
    8. now check the wp-admin control panel. for missing plugins.
    9. download the missing ones.

    Thread Starter adrianboston

    (@adrianboston)

    i have seen hundreds of similar ‘broken theme’ errors resulting in inability to see not only the blog but also the admin control panel. seems like the most common problem in WP.

    this error points to a fundamental problem with WP.
    that themes is even in an folder called ‘wp-content’ is a problem.

    themes are formal, decorative, ornamental, designed, a look n feel.
    the form should be separated from the content. form vs content is one goal of xml.

    a screw up in the form should never effect the content. yet, it seems that hundreds of users get blank pages in their blog and admin panel. some need to re-install WP. some have redo all their postings. whoa. what a pain just over a broken theme.

    the directory, wp-content should contain only website content. the dir should contain only uploads and cache. not fracking themes, or plugins, or upgrade.

    second, why have an effect on the admin panel. the binding of form with content might account for the foolish error of effecting the admin control panel with themes. who cares about themes on a control panel. why have any fricking theme on a control panel. again, very foolish.

    and,,,regarding the subject of content, why oh why use a DBMS for fracking xml and images. xml needs no DBMS since its already data aware. and images are best placed in a director. just stuff ALL CONTENT in wp-content. NO fracking DBMS. and then do away with wp-content/cache, since it is cached,,, in a filesystem. doh

    ok, so thats all the ranting for now. i was very impressed with WP, but now im less so. however, nice looking themes.

    Aha. It seems that some of the images are in the wp-content/upload area

    One reason to rename.

    The above offered a work around.

    Deleting wp-content removed all themes, including default. Therefore the need for an upgrade. It might be possible to simply upload any theme, rather than upgrade.

    Note: I would recommend renaming the folder rather than deleting it.

    Some of the images in media files did not load after this work. Perhaps because wp is looking for the latest cache that no longer exists in the new wp-content. Not sure.

    more to follow i guess

    i have the exact same problem but with autofocus rather than ‘cover’ theme

    however, deleted the theme does not revert back to default.

    i am using yahoo as host. is it because of caching by yahoo, or… that falling back to default is not always the case… for whatever reason.

Viewing 11 replies - 1 through 11 (of 11 total)