Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wpenman

    (@wpenman)

    acub, great. That works just fine.

    Thread Starter wpenman

    (@wpenman)

    I’ve made some progress on this. In /inc/admin/class-admin-meta-boxes.php, I’ve made it so wordpress displays a box to enter a link instead of a dropdown menu of past posts and pages.

    Old:

    <select name="<?php echo esc_attr( $link_id); ?>" id="<?php echo esc_attr( $link_id); ?>">
                    <?php //no link option ?>
                    <option value="" <?php selected( $link_value, $current = null, $echo = true ) ?>> <?php _e( 'No link' , 'customizr' ); ?></option>
                    <?php foreach( $tc_all_posts as $type) : ?>
                        <?php foreach ( $type as $key => $item) : ?>
                      <option value="<?php echo esc_attr( $item -> ID); ?>" <?php selected( $link_value, $current = $item -> ID, $echo = true ) ?>>{<?php echo esc_attr( $item -> post_type) ;?>} <?php echo esc_attr( $item -> post_title); ?></option>
                        <?php endforeach; ?>
                   <?php endforeach; ?>
                  </select><br />

    New:

    <input class="widefat" name="<?php echo esc_attr( $link_id); ?>" id="<?php echo esc_attr( $link_id); ?>" value="<?php echo esc_attr( $link_value); ?>" style="width:50%">

    But unfortunately, the link that I enter doesn’t carry over to the page. My guess is that I have to change some other part of the code that loads the link so that it doesn’t expect a page or post.

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