Topic RSS
Related Topics
5:33 pm
The template tag insert_cform() is a great tool when it comes to inserting a form into a page template. However, its use is rather limited, because it echoes a result instead of just returning it—which makes it unusable within i.e. filter or action functions.
@Oliver: I guess you've heard this before, so let me just add my 2 cents to the queue. ;) You could do something like this:
function get_cform($no='',$custom='',$c='') {
global $post;
$pid = cfget_pid();
if( !is_numeric($no) )
$no = check_form_name( $no );
if ( !$pid )
return cforms($custom,$no.$c);
else
return check_for_taf($no,$pid)?cforms($custom,$no.$c):'';
}
### insert_cform() still echoes (ensures backward compatibility)
function insert_cform($no='',$custom='',$c='') {
echo get_insert_cform($no,$custom,$c);
}
If I missed a function that already fulfills the same purpose, please ignore the suggestion and fill me in!
Most Users Ever Online: 959
Currently Online:
50 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3552
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5159
Posts: 18392
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote










