BBPress Steven Zahm : Replies Created

Forum Replies Created

Viewing 10 posts - 1,491 through 1,500 (of 15,332 total)
  • Author
    Posts
  • in reply to: Chosen Multiselect on Mobile #467174
    Steven Zahm
    Keymaster

    @ Karen

    You could try to use the method described here.

    It does require a bit of code but may provide the solution you are looking for.

    Let me know.

    in reply to: Having categories show in panel, first screen #467171
    Steven Zahm
    Keymaster

    @ Michael

    Look like I had one type in the code I gave… change this:

    echo '<a href="' . $entry->getPermalink() . '>';
    

    to this:

    echo '<a href="' . $entry->getPermalink() . '">';
    

    I m still unsure if this will do it though because there is quite a bit of javascript involved in make Gridder function the way it does. If this change does not work, it might not be easy to make necessary changes to the javascript.

    in reply to: Custom meta fields not imported #467167
    Steven Zahm
    Keymaster

    @ Age

    Yes, it is possible. But, I have not worked out the code to do so. I think it would be pretty straightforward…

    You would use the cncsv_map_import_fields filter to add the Certifications field mapping choice to the drop down.

    You would also use the cncsv_import_fields to register the callback to import the Certifications. Much like importing the meta code.

    The code within the function would be nearly identical to the code in the file class.cncsv-entry.php file in the processTerms() method around line 518. This file is part of the Connections CSV Import extension.

    Off the top, the only changes would be changing the taxonomy from category to certification and the elseif to add the default could be removed since it is not required.

    Something like this (untested):

    add_filter( 'cncsv_map_import_fields', 'cncsv_import_certifications_field_option' );
    function cncsv_import_certifications_field_option( $fields ) {
    
        $fields['certifications'] = 'Certifications';
    
        return $fields;
    }
    
    add_action( 'cncsv_import_fields', 'cncsv_import_certification_field_import', 10, 3 );
    function cncsv_import_certification_field_import( $id, $row, $entry ) {
    
        $termIDs = array();
    
        $parsed = $entry->arrayPull( $row, 'certification', $termIDs );
    
        if ( ! empty( $parsed ) ) {
    
            /*
             * Convert the supplied certifications to an array and sanitize.
             * Apply the same filters added to the core WP default filters for `pre_term_name` so the certification name
             * will return a match if it exists.
             */
            $certifications = explode( ',', $parsed );
            $certifications = array_map( 'sanitize_text_field', $certifications );
            $certifications = array_map( 'wp_filter_kses', $certifications );
            $certifications = array_map( '_wp_specialchars', $certifications );
    
            foreach ( $certifications as $certification ) {
    
                // Query the db for the term to be added.
                $term = cnTerm::getBy( 'name', $certification, 'certification' );
    
                if ( $term instanceof cnTerm_Object ) {
    
                    $termIDs[] = $term->term_id;
    
                } else {
    
                    // Add the new certification.
                    $insert_result = cnTerm::insert( $certification, 'certification', array( 'slug' => '', 'parent' => '0', 'description' => '' ) );
    
                    if ( ! is_wp_error( $insert_result ) ) {
    
                        $termIDs[] = $insert_result['term_id'];
                    }
                }
            }
    
        }
    
        // Do not set certification relationships if $termIDs is empty because if updating, it will delete existing relationships.
        if ( ! empty( $termIDs ) ) Connections_Directory()->term->setTermRelationships( $id, $termIDs, 'certification' );
    
    }
    
    • This reply was modified 8 years, 1 month ago by Steven Zahm. Reason: Code corrections
    in reply to: Use WordPress Media files for images or logos #467165
    Steven Zahm
    Keymaster

    @ Age

    Sorry, no, this is not possible. For a couple reasons…

    One, is Connections is actually older than the ability to access the WP Media Library. Two, many users (of private directories) have databases that contain thousands of entries. Having that many photos/logos in the Media library will negatively affect WP performance (meaning, slow it down) and make the Media Library nearly unable due to the large amount of images. So for performance reasons this ended up being a good thing.

    in reply to: Dutch translation #467164
    Steven Zahm
    Keymaster

    @ Age

    Thanks! I’ve added to the plugin so it’ll be in future updates.

    in reply to: Showing City on Main page #467121
    Steven Zahm
    Keymaster

    @ Jess

    Does the city code snippet work as expected? Meaning, is a new field present when you add/edit an entry? If it is present, is the city saved correctly?

    What is the exact path of your override card.php file?

    in reply to: Anniversary-and-Birthday-Email Error #467117
    Steven Zahm
    Keymaster

    @ giri

    You had posted the login publically. I made the post private but it does appear you noticed this and changed the login, which is good. If you wish to share an admin account so I can take a look, please create the account with this plugin:

    https://wordpress.org/plugins/temporary-login-without-password/

    Reply back, as a private reply, with the temp login link.

    in reply to: Having categories show in panel, first screen #467115
    Steven Zahm
    Keymaster

    @ Michael

    Well, this is untested… but the code would be something like this.

    Replace this:

        <?php $entry->getImage(
            array(
                'image'    => $atts['image'],
                'height'   => $atts['image_height'],
                'width'    => $atts['image_width'],
                'fallback' => array(
                    'type'     => 'block',
                    'string'   => ''
                    ),
                'style'    => $atts['image_opacity'] ? array( 'opacity' => $atts['image_opacity'], 'filter' => 'alpha(opacity=' . $atts['image_opacity'] * 100 . ')' ) : array(),
            )
        ); ?>
    

    with this:

    <?php
    
    echo '<a href="' . $entry->getPermalink() . '>';
    
    $entry->getImage(
        array(
            'image'    => $atts['image'],
            'height'   => $atts['image_height'],
            'width'    => $atts['image_width'],
            'fallback' => array(
                'type'     => 'block',
                'string'   => ''
                ),
            'style'    => $atts['image_opacity'] ? array( 'opacity' => $atts['image_opacity'], 'filter' => 'alpha(opacity=' . $atts['image_opacity'] * 100 . ')' ) : array(),
        )
    );
    
    echo '</a>';
    ?>
    
    in reply to: Parameters stripped off from Customizer URL #467114
    Steven Zahm
    Keymaster

    @ Age

    Ok, I made the change. Let me know how it goes!

    in reply to: Modified certifications to new extension #467112
    Steven Zahm
    Keymaster

    @ Age

    I took a look in the code… I was almost right use this as the meua key "66.9123". Notice I added quotes around the number.

Viewing 10 posts - 1,491 through 1,500 (of 15,332 total)